Install CakePHP 2.x in Ubuntu



 Requirements:
  • HTTP Server. For example: Apache. mod_rewrite is preferred, but by no means required.
  • PHP 5.2.8 or greater.

Download CakePHP 2.x at their website: http://cakephp.org/

Extract your downloaded file.

Copy and paste the contents of the Cake archive in /var/www/cakephp

Make it writable, open your terminal and type: sudo chmod 777 -R /var/www/cakephp

Create database.

Goto /var/www/cakephp/app/Config/ and rename your database.php.default to database.php.

Open database.php, then just replace the values in the $default array with those that apply to your setup. . A sample completed configuration array might look something like the following:

<?php
public $default = array(
    'datasource' => 'Database/Mysql',
    'persistent' => false,
    'host' => 'localhost',
    'port' => '',
    'login' => 'DatabaseUsername',
    'password' => 'DatabasePassword',
    'database' => 'DatabaseName',
    'schema' => '',
    'prefix' => '',
    'encoding' => ''
);

The security salt is used for generating hashes. Change the default salt value by editing /app/Config/core.php line 187. It doesn’t much matter what the new value is, as long as it’s not easily guessed.

<?php
/**
 * A random string used in security hashing methods.
 */
Configure::write('Security.salt', 'tYp3Anythin5H3r3');

The cipher seed is used for encrypt/decrypt strings. Change the default seed value by editing /app/Config/core.php line 192. It doesn’t much matter what the new value is, as long as it’s not easily guessed.

<?php
/**
 * A random numeric string (digits only) used to encrypt/decrypt strings.
 */
Configure::write('Security.cipherSeed', '7485712659625147843639846751');

If your web server is configured correctly, you should now find your Cake application accessible at http://localhost/cakephp



Comments

  1. I need to know how to configure the cake console to generate the code for cake 2

    ReplyDelete
  2. Hi Sanjit, I think your referring to Cake Bake.. check this links:

    http://developerguides.blogspot.com/2012/04/cakephp-2x-bake-in-ubuntu.html

    http://developerguides.blogspot.com/2012/04/cakephp-13-bake-in-ubuntu.html

    ReplyDelete

Post a Comment

Popular Posts