Php – “Permission denied” & 500 Internal Server error serving PHP in Mac OS X

apache-2.2httpd.confmac-osxPHP

I just set up Web Sharing in Mac OS X 10.6.2 Snow Leopard. My httpd.conf allows for ExecCGI and all the folders and files are readable by everybody and even writable by me.

I put a simple Hello World in index.php in my base site and yet my apache error log shows this:

[Thu Mar 18 00:17:18 2010] [error] [client 192.168.11.135] (13)Permission denied: exec of '/Users/abhic/Sites/index.php' failed
[Thu Mar 18 00:17:18 2010] [error] [client 192.168.11.135] Premature end of script headers: index.php

<html>
<head>
    <title> Hello </title>
</head>

<body>
    <?php echo "Hello"; ?>
</body>

</html>

is what my index.php looks like placed in /Users/abhic/Sites

My browser shows a 500 Internal Server Error

Any help would do me good in the middle of the night. I have been trying to solve this for way too long.

Thank you.

Best Answer

It looks like you may have attempted to configure php to be executed as CGI. This would not be the ideal implementation for PHP.

Do you have handlers specified? Is the module loaded?

If you provide your full configuration file, we should be able to help you.

Related Topic