N74JW said:
I am in the same boat as the O.P. here is what I have done;
[snip]
I did reinstall PHP per the instructions at the end of this thread. Any idea what to do next? Thanks in advance.
First, let's make sure you have an appropriate php5_module and that it is in the same place as the other Apache modules (this assumes Apache 2.2):
Code:
(0:33) new-gate:/tmp# cd /usr/local/libexec/apache22/
(0:34) new-gate:/usr/local/libexec/apache22# ls -l *php*
-rwxr-xr-x 1 root wheel 3770966 Aug 28 19:20 libphp5.so*
(0:35) new-gate:/usr/local/libexec/apache22# ls -l *rewrite*
-rwxr-xr-x 1 root wheel 164059 Aug 28 18:04 mod_rewrite.so*
Obviously, your dates and sizes may vary. If you have rewrite but not php, either php didn't install or it installed somewhere else (I've seen systems get confused when more than one Apache version is installed). If you have php but not rewrite, then your Apache modules are somewhere else and your system is confused. You can use the
# find
command to see where the rest of the modules are, in this case (may take a few minutes to complete while it searches the disk):
Code:
(0:41) new-gate:/tmp# find /usr -name mod_rewrite.so
/usr/local/libexec/apache22/mod_rewrite.so
Now, let's make sure that the necessary config stuff is loaded in httpd.conf. I'll post these as human-parseable diff output. Just open your
/usr/local/etc/apache22/httpd.conf and make sure you've got these lines added. The indentation, +, and ! characters are just diff's way of showing changes - don't include them in the config file. Note that there are many, many ways to write Apache configuration files - this is just one way (which I confirmed works here), so try it this way and later you can work on points for style:
Code:
LoadModule userdir_module libexec/apache22/mod_userdir.so
LoadModule alias_module libexec/apache22/mod_alias.so
LoadModule rewrite_module libexec/apache22/mod_rewrite.so
+ LoadModule php5_module libexec/apache22/libphp5.so
<IfModule !mpm_netware_module>
<IfModule !mpm_winnt_module>
...
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
! DirectoryIndex index.html index.shtml index.php
</IfModule>
#
...
# file specified in TypesConfig for specific file types.
#
#AddType application/x-gzip .tgz
+ AddType application/x-httpd-php .php
+ AddType application/x-httpd-php-source .phps
#
# AddEncoding allows you to have certain browsers uncompress
# information on the fly. Note: Not all browsers support this.
Now, make sure that Apache is restarted and using the new config file:
# /usr/local/etc/rc.d/apache22 restart
You should see something like this:
Code:
(0:42) new-gate:/tmp# /usr/local/etc/rc.d/apache22 restart
Performing sanity check on apache22 configuration:
Syntax OK
Stopping apache22.
Waiting for PIDS: 1433.
Performing sanity check on apache22 configuration:
Syntax OK
Starting apache22.
If you see any complaints from the sanity check, fix the errors in
httpd.conf and try again.
If you don't get any complaints, try accessing a php script on your web server. If it still doesn't work, look in
/var/log/httpd-error.log to see if there are any useful error messages in there.