CakePHP on Webfusion, Ubuntu 8.04, suPHP

April 20, 2010 by Adam · Leave a Comment 

If you install any CakePHP App on a Web Fusion Dedicated Server running Ubuntu 8.04 and suPHP you will likely get the following message:

Forbidden, perhaps you need to change the file permissions for this document or upload an index page.

This is because you need to add:

Options +FollowSymLinks

To the top of your .htaccess file inside the webroot folder.

Your homepage should then start loading after this, but clicking on any links will present you with a new error:

Internal Server Error, this is an error with your script, check your error log for more information.

You will need to modify .htaccess again and change the line:

RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]

to

RewriteRule ^(.*)$ /index.php?url=$1 [QSA,L]

The first is needed because suPHP/pretend root stops you from setting Options +FollowSymLinks in your httpd.conf file, and Webfusion don’t set it for you, I don’t really know why the second one is needed, but it seems to work.

Edit: Adding:

RewriteBase /

before

RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]

will also work, instead of adding the / to the above line

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks

Related posts:

  1. Setup LAMP stack on Ubuntu 10.04 the easy way…
  2. Integrating the Auth Component with a bespoke 3rd party Single Sign-On Service in CakePHP
  3. Simple “MVC” Javascript for CakePHP

About Adam
Adam is senior developer for Image+ Ltd in Coventry, England. He has been developing websites for over 10 years, and currently freelances through his own company, Votive Media. Follow him on twitter for more!

Comments are closed.