I am using ubuntu 14.04 for and LAMP configuration run on it. In some projects of cakephp, it didn't show some content or didn't redirect the page according to need of code. I think it is problem due to cakephp is not installed on my system. I actually don't know how to install cakephp or is it really need to install cakephp after installing LAMP environment and phpmyadmin.

Please suggest.

Thanks in adv


Steps are almost same but in Windows we did that using GUI or in Windows Explorer and in Ubuntu we'll do it through terminal or you can say using commands.

Step 1: Open the command prompt (terminal) and type the following command

cd /var/www/html

Step 2: Type the below command to download the cakephp.

$ sudo wget https://codeload.github.com/cakephp/cakephp/legacy.zip/2.5.2

where 2.5.2 is the latest stable version of CakePHP.

Step 3: Use the following command to unzip the downloaded zip file.

$ sudo unzip 2.5.2

Step 4: Rename extracted folder.

$ mv cakephp-cakephp-736e999/ cake

where cakephp-cakephp-736e999 is the name of extracted folder.

To run CakePHP on browser use this path localhost/cake.

Step 5: Go to cake folder.

$ cd cake

And change permissions to app/tmp folder.

$ sudo chown -R root:www-data app/tmp
$ sudo chmod -R 775 app/tmp

Step 6: To make script writable perform these steps:

$ apache2ctl -M

If you see mod_rewrite or rewrite_module in the list shown then script is writable. If not then to enable it type this command:

$ a2enmod rewrite

Step 7: Type:-

  cd /etc/apache2 
$ sudo nano  apache2.conf

Set these lines in the file:

    <Directory /var/www>
       Option Indexes FollowSymlinks
       AllowOverride All
       Required all granted

Press Ctrl+X, then press Y and Enter to save the file.

Restart apache:

$ sudo service apache2 restart

Step 8: Now go to app/Config and:

$ cd /var/www/html/cake/app/Config
$ sudo mv database.php.default default.php

Refresh localhost/cake page. Now database file is detected but still we have to create a database as it will show could not connect to database.

Step 9: Open localhost/phpmyadmin on browser. Login using your username and password and create a database named as cake. After this edit database.php file.

$ sudo nano database.php

Set host as localhost, username is your phpmyadmin username, password is your phpmyadmin password and database name.

Refresh localhost/cake page. Now database is detected.

Step 10: To remove the salt and seed error shown on top of the localhost/cake page we have to edit core.php file.

$ sudo nano core.php

Find this section and replace both the strings with any random strings or you can use these strings also.

/* A random string used in security hashing methods. */


/* A random numeric string (digits only) used to encrypt/decrypt strings. */

Configure::write('Security.cipherSeed', '55857485748594575784348784787475');

Then press Ctrl+X, press Y and Enter to save file. Refresh localhost/cake page. And its done.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.