403 Forbidden error on Mac when trying to browse local files using Apache
I am having a problem where I am unable to view local image files like favicon.ico, .png, .svg.gif or .jpg when starting apache locally. I am using apache 2.2.26 and I am configured on a Mac using the Sites folder. Everything works fine and I can even view the images inside my PHP and html files locally, but when I enter them directly into the browsers url field I get this error:
Forbidden
You do not have permission to access /kitten.jpg on this server.
If I try to navigate to the .php file or .html file, I don't get this error. The page renders just fine, and as I said, if there are image files on the page, it pulls up everything as seen. This is a minor problem as it prevents me from seeing my icon and seeing images in the URL field of my browser, but this is what I'm very curious about why this is happening. I have checked the permissions on my files and I don't see anything great about these specific image files. It seems like there must be something funny in the config files (maybe httpd.conf? Or my user.conf file?). I'm not an apache expert and any help would be appreciated. I also tried to find this in other posts on stackoverflow, and while other people may have a similar problem as it never seems to me to be this particular problem,so I hesitate to move forward with these subsequent decisions. Hence my question about this particular issue. Help is appreciated, thanks.
source to share
Can you view your DocumentRoot? eg:
cd /Library/WebServer/Documents/
if you can use your docs you do this:
sudo chown -R www-default:www-default /Library/WebServer/Documents
or
sudo chmod -R 755 /Library/Webserver/Documents
if you cannot use doucument and you get a "permissions" error, you must use root and set user and groud for yours. or set 755 Resolution
source to share