Mac OS permission problem after installing PHP / Apache / MySql

I'm trying to setup a an Apache / MySql / PHP environment to develop dynamic websites. I've installed, and enabled and got working all of the components, edited and amended the httpd.conf and php.ini files as directed in both written material and following a tutorial.

This is my first attempt at doing this on a Mac. I've done this without problem on a Windows PC using Wamp but trying to get this working on my MacPro desktop.

The problem is when I open a browser to view a file in my local user sites folder, i.e. test.php that  I get a permissions error.

You don't have permission to access /~Richard/test.php on this server.


The url I try to goto is http://localhost/~Richard/test.php and this results in this 403 error.

Being a Mac newbie could someone please guide me as what I need to do to provide the right permissions on which folders and how best to set them to get this up and running.  Thanks.

Who is Participating?
You essentially just need to have read permissions to the world. So you need 755 for directories and 644 for files. You can do this using the chmod command line tool. (i.e. chmod 755 directory or chmod 644 filename).
Also, note that if you are trying to change the permissions of a file or directory that is not currently owned by your user (i.e. a system folder or file) then you may need to add a "sudo" to the beginning of the commands I listed above.
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

my2eggsConnect With a Mentor Commented:
You might want to note that the above link is written for the apache that comes with Mac OS X. If you installed your own version of apache then you might not have a users directory in your etc/apache folder. If you not then you can simply add the information in step 3 directory to your httpd.conf file. Also note for all this to work the way you want it you will have to have the userdir_module loaded in apache.
richard1966Author Commented:
Thank you both for this - The Apple Support article nailed it straight away and the advise from my2eggs although not used to sort this was very good as well so thank you to you both.

Despite Mac been a a little more quirky to set up, it is so much better than a PC and that comes from someone who is a recent convert.

Thanks again!
richard1966Author Commented:
Asking the right question is key to getting an answer - what I should have stated in this question is the following - Web Sharing - "Forbidden 403" message appears instead of website content - thanks to the experts on here they were able to figure out what I needed to know.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.