Installing CakePHP


CakePHP is a rapid web development framework for PHP language. And yeah I believe you are here to read this post only because you want to get started with CakePHP. And if its not then probably you want to know more about CakePHP, for more details why no you check this out : http://cakephp.org/ ?

Okey now lets get started. Download the latest version of CakePHP from GitHub or clone it. Extract the archive file to the webroot directory i.e. for apache2 its /var/www/html and if you are on windows then for xampp it would be htdocs and for wamp it would be www. And if you are on a cpanel hosted web server then it would possibly be /public_html. So anyways you should be able to place all the files to your webroot directory.
Now the directory structure should look like this:
->app
->lib
->plugins
->vendors
->index.php
->travis.yml
->.editorconfig
->.gitignore
->CONTRIBUTING.md
->README.md
-> build.properties
-> build.xml
-> index.php

app,lib,plugins,vendors are directories. Now the next step is to configure the database configuration.
Now rename database.php.default in app/Config/ to database.php. Minimum change to be made is on host, login, password, and database.

public $default = array(
'datasource' => 'Database/Mysql',
'persistent' => false,
'host' => 'localhost',
'login' => 'root',
'password' => 'password',
'database' => 'cakephp_app',
'prefix' => '',
//'encoding' => 'utf8',
);

After this step, one more step to do is make app/tmp/ directory writeable by apache process. Better you give full read, write permission. On *nix systems, you can use 'chmod -R 777 app/tmp' in teminal. Now its installed and you're ready to go.

But it would be great if you get DebugKit plugin installed too. You can clone in app/plugin/   directory or download and extract to the app/plugin directory from https://github.com/cakephp/debug_kit. To start with debug kit you just need to do is do a few configuration.
In app/Config/bootstrap.php add a line:

 CakePlugin::load('DebugKit');
and in app/Controller/AppController.php add  'DebugKit.Toolbar' to public $components array in the App Contoller class:

class AppController extends Controller {
public $components = array(
'DebugKit.Toolbar',
//other components
);
}

You can now ready to jump right on to baking with CakePHP.

Comments

Post a Comment

Popular posts from this blog

Automate file upload in Selenium IDE

How To Install and Configure Nextcloud