403 forbidden error for Image


Recently I saw that some of the images were not displayed on a particular webpage, I checked if the image was available under the images folder, yes it was with the correct name!

I checked the Chrome Browser's console logs and It said: GET http://localhost/myapp/images/4.jpg 403 (Forbidden). I tried accessing the image via URL and I could see this access type error!

Access forbidden!

You don't have permission to access the requested object.
It is either read-protected or not readable by the server.

If you think this is a server error, please contact the webmaster.

Error 403

localhost
Apache/2.4.10 (Unix) OpenSSL/1.0.1i PHP/5.5.15 mod_perl/2.0.8-dev Perl/v5.16.3

Reason for 403: Well it was obvious that it has something to do with the access permissions of the file, as I work on a Unix based operating system.

Solution to resolve 403 forbidden error:

Check the access permissions for the file: Read permission should be allowed for the Others, its best to make permission settings to 644 using CHMOD

644 = (rw- r-- r--): group/others can to read the file. The owner can write to it, others cannot write or execute it. I hope it helps someone!





Hello there!,

You are using AdBlocker!

I am an independent developer trying to help fellow developers and students to resolve issues faced on a day-to-day basis, we 'Code to Care' . There is a lot of expenses involved in hosting and managing a website that's the reason we have ads.

A humble request to you to disable adBlocker on Code2care.org and support us pay our bills.

Thanks,
Cod2care - Line's of code for change.

To see contents reload page after unblocking
Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities. Students and Software Developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include Learnings, Video Tutorials, Code Snippets, Tips-n-tricks, How Tos, Blogs, Articles, etc. on various platforms like Windows, Mac, Linux, Mobile platforms, etc. Technologies/Languages like Java, Objective-C, PHP, .Net, Android, SharePoint, jQuery, HTML, CSS, etc.