View Full Version : Apache causing me troubles...

Mar 15, 2008, 12:54 AM
Hi all,

Hoping that someone here can help me out, I've been trying to get php working with apache under leopard and not having much luck...

It seems that all that was needed was to uncomment a couple of lines from the httpd.conf file namely

LoadModule php5_module libexec/httpd/libphp5.so
AddModule mod_php5.c


AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

Then i saved the file, restated apache and no dice.... when i try running index.php that contains <?php phpinfo(); ?> it just prints out the text instead of showing the php info stuff.

Now I upgraded my 10.4 install to 10.5 and it seems like some of the config options changed, and that might be causing me trouble.

How do i check if apache is even reading the httpd.conf file correctly? I tried putting errors in, renaming it (as well as the httpd.conf.bak) and each time apache started ok, what is the deal here? I though it would fail to run if the config file was missing or contained errors?

I have been trying to fix this for hours and had no luck at all. I can't seem to find other posts or articles anywhere describing this problem, it just seems to work...


Mar 15, 2008, 01:06 AM
Is anything being logged to your Apache log? /private/var/log/apache2/error_log

Always the first place to look. =)

Mar 15, 2008, 01:07 AM
Well about 5 min after posting on here i fixed it....it wasn't reading that httpd.conf file because i was editing the one in the wrong directory....

i was in /etc/httpd instead of doing the one in /etc/Apache2

seems like it's working now. pity i had to post my stupidity for all to see :D

Is anything being logged to your Apache log? /private/var/log/apache2/error_log

Always the first place to look. =)

Thanks for the suggestion, Ill add that to my list of "important apache directories to remember"

Mar 15, 2008, 12:19 PM
Not a problem. A lot of vendors like Apple, Red Hat, etc. install software in non-standard places. For example, Apple defaults Apache to /etc/apache2 and Red Hat places it in /etc/httpd, so it's common to be working on the wrong file. =P