403 error-not able to solve usual way (OS X ) 1.7.3 [SOLVED]

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

403 error-not able to solve usual way (OS X ) 1.7.3 [SOLVED]

Postby MeltingDog » 29. November 2011 08:29

Hi all,

I am trying to run a php script within a Word Press post. All works ok except for image paths - the images dont show. When I paste the image into my browser I get a 403 error. I googled how to solve this and most sites say to replace 'Allow from localhost' in the httpd-xampp.conf file with 'Allow from 127.0.0.1'

I looked in my file and I have this instead:

# New XAMPP security concept
#
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
Order deny,allow
Deny from all
Allow from ::1 127.0.0.0/8 \
fc00::/7 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 \
fe80::/10 169.254.0.0/16

ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</LocationMatch>

Can anyone help me fix this?

Thanks!
MeltingDog
 
Posts: 7
Joined: 29. November 2011 08:24
Operating System: OSX

Re: 403 error - not able to solve usual way

Postby Sharley » 29. November 2011 08:46

That particular section in the httpd_xampp.conf file only protects the XAMPP system folders as depicted in the <LocationMatch> line.

What is the path to your images?

What path are you pasting in the browser to try and access the images separately?
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: 403 error - not able to solve usual way

Postby MeltingDog » 29. November 2011 08:58

Hi Sharley,

The image path is:

http://localhost/xampp/wpsite/uploads/chair.jpg

Could it have something to do with the folder permissions? Does WP protect its directories?
MeltingDog
 
Posts: 7
Joined: 29. November 2011 08:24
Operating System: OSX

Re: 403 error - not able to solve usual way

Postby Sharley » 29. November 2011 09:04

You need to drop the xampp from the path as that relates to the xampp folder in the htdocs folder and is one of those protected XAMPP system folders mentioned above.

Just type http://localhost/wpsite/uploads/chair.jpg and you should see your image.

Let me know if you still can't see your image.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: 403 error - not able to solve usual way

Postby MeltingDog » 29. November 2011 09:16

Hi Sharley,

I'm afraid that just gives me a 404 error...
MeltingDog
 
Posts: 7
Joined: 29. November 2011 08:24
Operating System: OSX

Re: 403 error - not able to solve usual way

Postby Sharley » 29. November 2011 09:24

localhost/wpsite/uploads/chair.jpg =
htdocs/wpsite/uploads/chair.jpg

If that is not the path to your image then you need to adjust accordingly

If your wpsite is in htdocs/xampp then that is the wrong location and would need to be moved back into the htdocs folder - the htdocs folder is the Apache server DocumentRoot.

I don't have a mac to verify the actual paths but the above explanation should help you find out the correct path to your image.

Is there an error.log file in the Apache\logs folder that will show you why Apache does not like the path you are requesting?
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: 403 error - not able to solve usual way

Postby MeltingDog » 04. December 2011 01:44

Hi Sharley,

Thanks for the advice - the site was indeed hosted in htdocs/xampp. I have moved it to the htdocs folder. However the error still occurs.

Heres what the error log says:
(13)Permission denied: file permissions deny server access: /Applications/XAMPP/xamppfiles/htdocs/wpsite/uploads/chair.jpg

Would I need to just change the read/write options on that folder on my computer?
MeltingDog
 
Posts: 7
Joined: 29. November 2011 08:24
Operating System: OSX

Re: 403 error - not able to solve usual way

Postby MeltingDog » 04. December 2011 01:55

OK its fixed!!

The permissions of all the photos (dummy place holders I just grabbed off Google) where set to no access at all. I am new to using a Mac and think perhaps this is something to do with the way things are calibrated when you grab them off the net. Never had this issue with the PC before, and it worked with one of the images I already had existing on my hard drive. Changed access of the files and moved the site directory from xampp folder to htdocs and it works perfectly.

Thanks heaps for your help Sharley!
MeltingDog
 
Posts: 7
Joined: 29. November 2011 08:24
Operating System: OSX

Re: 403 error - not able to solve usual way

Postby Sharley » 04. December 2011 02:02

You're most welcome and many thanks for your feedback - I am please it is now working. 8)

Good luck and my best wishes. :)
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3


Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 13 guests