Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP Using PHP with MySQL Limiting Records in SQL Queries Using LIMIT with Descending Order

Forbidden. You don't have permission to access /shirts/ on this server.


I am using Mac O.S X and MAMP Pro. When I clicked shirts button. Web page gives error message "Forbidden You don't have permission to access /shirts/ on this server. "

Another buttons work perfectly. I could not find my problem ?


3 Answers

Andrew Shook
Andrew Shook
31,709 Points

Check to ownership and permissions of the file that servers up the shirts page.

Hello , which directory should I change permissions or ownership ? because I checked everything htdocs folder's sharing & permissions. everyone can read & write.

best regards

If shirts isn't a directory

then you need to make sure that its a valid url, maybe it's a slug generated by your application.

Josh Torres
Josh Torres
8,945 Points

Sometimes you need to change the User and Group settings in your httpd.conf. I am not sure where that file is in MAMP Pro but it should be easy to find. It holds the configuration settings for the Apache server in MAMP. For my httpd.conf, I change the code below:

#User _www
#Group _www

User Josh
Group staff

I changed the User from _www to Josh, which is my user account name on my computer. Then I changed the Group to staff, which is generally the group that you will need to put.

Hope this helps!