Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I enabled Apache2 and PHP 5.3 on my Mac Mini and have setup a virtual host. However when I browse to http://{MyVirtiualHost}/Index.php I get the error:

You don't have permission to access /Index.php on this server

I have set the permissions on the folder where my website is installed to 0777 via chmod but still no luck.

http://{MyVirtualHost}/ returns the following:

It Works!

What are the correct permissions to set for PHP to be activated correctly on the Mac?

share|improve this question
Have you tried HTML first, or how do you know it's a PHP issue? – Daniel Beck May 29 '12 at 20:26
@Daniel, good question. HTML does not work either. So more than likely my ignorance of setting up Apache. Digging deeper. – Rams May 30 '12 at 11:34
up vote 1 down vote accepted

This looks like a message from Apache. Most likely because you have not configured Apache to give you access to your document root.

Where does the text "It works" come from? Is it from an index.html file located you have made?

"It works" is normally the html which the default Apache sends when you have not (re)configured the document root. So it really mean: it work, now go configure apache to serve html from your own document root.

share|improve this answer

I would double check to make sure the "index.php" file has had it's permissions updated. Make sure to use chmod -r (recursive). This will make the permission change go through all subdirectories and files. Since it sounds like index.php was created before the directories permissions where changed this might be the case.

share|improve this answer

Permissions, permissions, permissions I had to enable Directory level permissions on the Directory I was trying to access my .php file from.

Added a

<Directory "path to my directory">
    Allow from all

to httpd.conf

to get the permissions correct.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .