CakePHP on Debian 5 (Lenny)

Select distribution:
Traducciones al Español
Estamos traduciendo nuestros guías y tutoriales al Español. Es posible que usted esté viendo una traducción generada automáticamente. Estamos trabajando con traductores profesionales para verificar las traducciones de nuestro sitio web. Este proyecto es un trabajo en curso.

This guide has been deprecated and is no longer being maintained.

CakePHP is a framework used to develop PHP applications quickly. Many people choose CakePHP because of the simple deployment process and extensive documentation available on the CakePHP website.

Before installing CakePHP, we assume that you have followed our Setting Up and Securing a Compute Instance as well as our LAMP guide. If you are new to Linux server administration, you may be interested in our introduction to Linux concepts guide, beginner’s guide and administration basics guide.


For this guide, we’ll be installing the latest version of CakePHP, which is currently at 1.2.6. Make sure you download the latest version of CakePHP by checking the CakePHP website. Issue the following commands to install CakePHP on your Linode:

cd /srv/www/
tar xvfz cakephp-cakephp1x-1.2.6-0-gbe7ddfb.tar.gz
rm cakephp-cakephp1x-ef18ab2.tar.gz
mv cakephp-cakephp1x-ef18ab2/ cake_1_2
chown -R www-data:www-data cake_1_2/app/tmp/

At this point, your installation of CakePHP is considered to be deployed for development purposes. You can now begin developing CakePHP applications. If you’re using your domain for a single CakePHP application, continue following the guide to deploy CakePHP in production mode.


The transition from a development installation of CakePHP to a production installation is easy. After following the steps above, open the Apache configuration file for the website you’re installing CakePHP to. In our example, this file is located at /etc/apache2/sites-available/ You’ll need to change the DocumentRoot to reflect the path of the application in CakePHP, which in our example is /srv/www/

File: /etc/apache2/sites-available/
<VirtualHost *:80>
     DocumentRoot /srv/www/
     ErrorLog /srv/www/
     CustomLog /srv/www/ combined

You’ll also want to adjust the debug level for CakePHP. The line controlling the debug level is in the following file.

File: /srv/www/\\_html/cakephp-2.4.5/app/Config/core.php
Configure::write('debug', 2);

Change the 2 to a 0. Run the following command after saving and closing the file:

/etc/init.d/apache2 reload

You’re now running a production version of CakePHP, ready for development!

Testing CakePHP

If you’re new to CakePHP, you may want to begin with their 15 minute blog tutorial. You can find the 15 Minute Blog Tutorial on their manual page. Congratulations! You have now successfully installed CakePHP on your Debian Linode!

More Information

You may wish to consult the following resources for additional information on this topic. While these are provided in the hope that they will be useful, please note that we cannot vouch for the accuracy or timeliness of externally hosted materials.

This page was originally published on

Your Feedback Is Important

Let us know if this guide was helpful to you.

Join the conversation.
Read other comments or post your own below. Comments must be respectful, constructive, and relevant to the topic of the guide. Do not post external links or advertisements. Before posting, consider if your comment would be better addressed by contacting our Support team or asking on our Community Site.
The Disqus commenting system for Linode Docs requires the acceptance of Functional Cookies, which allow us to analyze site usage so we can measure and improve performance. To view and create comments for this article, please update your Cookie Preferences on this website and refresh this web page. Please note: You must have JavaScript enabled in your browser.