Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

3 Answers

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
add comment

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
add comment

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
</Directory>

to httpd.conf

to get the permissions correct.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.