Cake PHP on shared hosting environment

Want to install CakePHP on 1and1, Hostgator, Bluehost, Godaddy, Dreamhost and other shared hosting accounts?

Some users on shared hosts without access to their httpd.conf directives may not be able to change their DocumentRoot to reflect the production setup. Users in that situation may want to try and structure their Cake installation as follows. The Cake installation is found at /path_to_cake_install, and the DocumentRoot (which cannot be changed) points to/public_html.

/public_html (= contents of /app/webroot)

Essentially, you copy the contents of Cake's /app/webroot folder into your existing DocumentRoot. In order to tell Cake where the webroot files are, add the following lines to the index.php file in your DocumentRoot folder (/public_html/index.php in the example above.)

 define('ROOT', BASE_DIR.'/path_to_cake_install');
define ('APP_DIR', 'app');
define ('WEBROOT_DIR', '/public_html');