Hywel said:
Apache doesn't have a setup for PHP. PHP doesn't have one for Apache
either - you have to configure it yourself.
Right, but a lot of Apache goodies have to be tweaked.
Here are notes from what I had to do to get it running:
______________
Installing php in apache.
(This is for Slackware 10.)
Assumes apache already up and running:
Locate php.ini configuration file:
/etc/apache/php.ini
cp /etc/apache/php.ini /usr/local/lib/php.ini
Locate the module "locate libphp":
/usr/libexec/apache/libphp4.so
Locate httpd.conf:
/etc/apache/httpd.conf
User nobody
Group nobody
Uncomment the line:
Include /etc/apache/mod_php.conf
...so that it will load.
"AddModule mod_php4.c" not required, doesn't work either.
Contents of the uncommented file:
/etc/apache/mod_php.conf:
---
# mod_php - PHP Hypertext Preprocessor module
# Load the PHP module:
LoadModule php4_module libexec/apache/libphp4.so
# Tell Apache to feed all *.php files through the PHP module:
AddType application/x-httpd-php .php .php4
# ... and as many more as wanted, seperated by spaces.
# This will display PHP files in colored syntax form. Use with caution.
#AddType application/x-httpd-php-source .phps
---
Restart Apache. Do NOT depend on "http restart" !!!
Use ps -e to kill it and then restart with httpd
all as root. Then it should work.
Testing scripts:
Go to
http://localhost,
follow webdocs link, and go to test directory.