[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 376
  • Last Modified:

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 Lynda.com 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.

**********
Forbidden
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.

0
richard1966
Asked:
richard1966
  • 3
  • 2
2 Solutions
 
my2eggsCommented:
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).
0
 
my2eggsCommented:
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.
0
 
nichicksCommented:
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
my2eggsCommented:
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.
0
 
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!
0
 
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.
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now