Re: [PHP-INSTALL] Installation issue

[email protected] (Keith Roberts)
Newsgroups php.install
Message-ID <[email protected]>
On Sun, 6 Jul 2008, Jerry Adair wrote:

> To: [email protected]
> From: Jerry Adair <[email protected]>
> Subject: [PHP-INSTALL] Installation issue
> 
> Hi,   I have (seemingly) successfully installed both 
> Apache 2.2 and PHP 5.2.6 on my PC here at home.  I 
> followed the installation instructions carefully and have 
> visted the FAQ sites and help guides.  Still, I cannot get 
> an embedded PHP script (in a HTML file) to be executed by 
> Apache.  I can run PHP as stand-alone without problem and 
> when I type in http://localhost I see the "It Works!" 
> message.  There are no errors reported in the Apache error 
> log.  I noticed in the PHP documentation that if I can see 
> the php source when I select "View Source" from the 
> browser that this means it is not being handed over to 
> Apache, so there is a problem with configuration.  I have 
> tried both methods (CGI and "As Module") but neither make 
> a difference in the outcome.   HELP?!   Thanks,
>
> Jerry

Hi Jerry. Your almost there.

As you state, the problem appears to be with your Apache 
configuration.

In your Apache configuration file httpd.conf, you should 
have the following entry to load the php module:

(I have split my Apache loadable modules section into a 
seperate include file, as these modules can change from one 
version to the next of Apache. This allows me to continue to 
use my main customised httpd.conf file across upgrades, and 
then just create a new loadable modules include file, for 
the latest Apache version.)

#-----------------------------------------------------------
# Dynamic Shared Object (DSO) Support
Include conf/F8-dso-modules-2.2.8

# the php install script will look in httpd.conf file
# for 'LoadModule' directives, and create one if it does not 
# exist.
#
LoadModule php5_module        modules/libphp5.so

#-----------------------------------------------------------

That should load the module into Apache.

Assuming that the Apache php module is loaded, it looks like 
the only thing left to do is edit your Apache httpd.conf 
configuration file, to tell Apache to pass your php-enabled 
web pages to the Apache php module for processing, like 
this:

# AddType allows you to add to or override the MIME configuration
# file mime.types for specific file types.
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz

# php specific filetypes
AddType application/x-httpd-php .php
AddType application/x-httpd-php .hml
AddType application/x-httpd-php .htm
AddType application/x-httpd-php .html

Basically, you can use any filename extension you want for 
php-enabled web pages, to send the contents of that file to 
Apache's php module for processing. Just add it to the list 
above, and php will process it.

I can't understand why the PHP installer doesn't modify this 
part of the httpd.conf file, to complete the PHP Apache 
module installation? Maybe that's an overdue bug 
report/feature request to the php developers?

HTH

Kind Regards,

Keith

-----------------------------------------------------------------
Websites:
http://www.php-debuggers.net
http://www.karsites.net
http://www.raised-from-the-dead.org.uk

The mind of the prudent is ever getting knowledge, and the
eear of the wise is ever seeking, inquiring for and craving
knowledge. Pr. 18:15 Amp

All email addresses are challenge-response protected with
TMDA [http://tmda.net]
-----------------------------------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.