[PLUG] http & php -- AAARRGGHH!

Alan alan at clueserver.org
Fri Mar 29 01:06:40 UTC 2002


On Sunday 24 March 2002 02:17, Bruce Kingsland wrote:
> Howdy,
>
> According to the installed docs for apache, there is a way to turn on
> PHP, PYTHON, PERL, etc. But I can't seem to get it to work.
>
> Inside the /etc/httpd/conf/httpd.conf file, there are a number of
> "IfDefine HAVE_PHP" type directives, and there are instructions on how
> to invoke them using "httpd -D HAVE_PHP", but whenever I attempt that,
> I get a usage list like "{start|stop|restart|...} that doesn't include
> the -D usage. However, if you run "httpd --help" you _do_ get a usage
> instruction that includes the -D option.
>
> Then, some unexpected flash of brilliance reminded me that the file
> should not be called 'index.html'; it should be called 'index.php4'.
> Making this change caused the php code I placed on that page to start
> working.
>
> One would think *that* bit of info would be mentioned in the "how to
> test your installation" document that I was reading when I got into
> this very long configuration debugging session to begin with!

Actually it is pretty easy to get these to work.

First of all you need to check if mod_php (or any of the others) are 
installed.

rpm -qa | grep php

If they are, then you need to check to make sure the modules are enabled in 
/etc/httpd/conf/http.conf.

Check to see if the "LoadModule" and "AddModule" lines for the version of php 
you are using are uncommented.

Restart apache:

/etc/init.d/httpd restart

NOTE: You do *not* need to add the information to the start script in any 
way.  The init script does this for you automagically. (It looks for what 
libraries and modules are available and builds the -D parameters each time it 
is run.)

Hope that helps.





More information about the PLUG mailing list