Getting 403 forbidden error after upgrading to PHP5

After installing PHP5 all php files returned a 403 forbidden error, the problem, and solution, lies with your .htaccess file.

Published in Web Development on Tuesday, September 25, 2007 by Ben Vallack
1 comments

RSS Print Email to a friend

I am doing some testing and have installed PHP 5 on a development server. I had a site installed on the server that was working correctly, complete with quite an elaborate .htaccess file handling many redirects and rules. However, after installing PHP5 it turns out any php file I tried to view just returned a 403 Forbidden error. I began to scratch my head. Searching on Google didn't immediately bring up a solution either. However, I eventually narrowed it down to the fact that I needed to add Options +FollowSymLinks to my .htaccess file. That solved it all. :)

Just a quick one but hopefully it will help others in moments of panic.

About the author

Ben Vallack is Creative Director at Phototropic Productions. His many roles include web design, photography, camera operating and editing.

Comments

  1. Here is the proper way to troubleshoot that error: A. Error code start 4xx is generated because of client browser request. A 403 error code means client browser (or person who is trying to access your site) cannot access the requested URL. It can be caused by many reason a) A 403 status code indicates that the client cannot access the requested resource. It means the wrong username and password were sent in the request, or that the permissions on the server do not allow what was being asked. b) No default directory index page is present. Upload Index.html or Index.htm file. Directive DirectoryIndex defines the default index page name. Open your apache configuration file, find out default index file name, and upload the same file to directory: DirectoryIndex index.html index.cgi index.pl index.php index.xhtml c) Make sure the CGI script requested have executable permissions set on files. Use chmod command to set permission: $ chmod x file.cgi d) Make sure you have permission to use .htaccess file for Apache web server. If Apache has overrides, disabled you will bump back with a 403 error.

    Written on Friday, February 1, 2008 at 20:27hrs by T1 Lines

Notebook

Products

Landscape Leaps

Enjoy the view from 96 stunning interactive 360º panoramic images and leap from one location to another. Learn more

Swiftlet

Swiftlets are a kind of Bookmarklet. Once clicked, they email the address of the page you're currently looking at to a person you choose.
Get Started

Platypus

Platypus is a fast, lightweight, 'web 2' application that makes timing tasks and creating invoices effortless. Features zero learning curve interface with live editing.
Get Started

Services

We create no-frills, usable websites. Accessibility and content reign supreme. Search engine optimization goes hand in hand with this philosophy and, as Jen Bryant discovered, a Phototropic Productions CSS website rebuild can get you to number 1 on Google. Learn More

By using a small High Definition video camera we can be very flexible as well as discrete. Virtues that many production companies loose in their efforts to 'appear professional' by using bigger cameras where they aren't always necessary. Learn More

Our background in fine art means we can take high quality photographs in a variety of situations. Whether you need some pictures on a white backgrounds of a product line-up or are after a family portrait, our photographs will leave a lasting impression.
Learn More

As with websites, DVDs need to be accessible and usable. The creative freedom allowed by both can be easily over-used. We know where to stop and allow the content to do its work. Our DVD Authoring services can include any of the features the DVD format supports as well as high definition Blu-Ray encoding. Learn More

Advertisement