Getting Started with CakePHP

CakePHP is widely used framework of PHP. It is completely build in MVC structure and almost have all built in functions which boost your web application.
What you need:

  • A running web server. I am going to assume you’re using Apache, though the instructions for using other servers should be very similar. I might have to play a little with the server configuration, but most folks can get CakePHP up and running without any configuration at all. Make sure you have PHP 5.2.8 or greater.
  • A database server. I going to be using MySQL server in this tutorial. You’ll need to know enough about SQL in order to create a database: CakePHP will be taking the reins from there. Since I’m using MySQL, also make sure that you have pdo_mysql enabled in PHP.
  • Basic PHP knowledge. The more object-oriented programming you’ve done, the better: but fear not if you’re a procedural fan.
  • Finally, you’ll need a basic knowledge of the MVC programming pattern. A quick overview can be found in Understanding Model-View-Controller. Don’t worry, it’s only half a page or so.

Download CakePHP from: https://github.com/cakephp/cakephp/releases/tag/2.6.7
Extract and move it to Apache www directory.
The Structure:

/app
/lib
/plugins
/vendors
.htaccess
index.php
README

Now create a Database in MySQL.
And set up the config file in /app/Config/database.php

<?php
public $default = array(
'datasource' => 'Database/Mysql',
'persistent' => false,
'host' => 'localhost',
'port' => '',
'login' => 'cakeBlog',
'password' => 'c4k3-rUl3Z',
'database' => 'cake_blog_tutorial',
'schema' => '',
'prefix' => '',
'encoding' => 'utf8'
);
?>

 
 
Note if you are getting 500 internal server error while executing cakephp in Browser then check Apache mod_rewrite mod is enable.
That’s it for now. Now in next tutorial we will start how to write code and manage controller, models & Views


Posted

in

by

Tags:

Comments

2 responses to “Getting Started with CakePHP”

  1. nadim Avatar
    nadim

    pls give me a code for send email from cakephp