Language:

Version:

Page Contents

This tutorial will walk you through the creation of a simple CMS application. To start with, we’ll be installing CakePHP,
creating our database, and building simple article management.

Here’s what you’ll need:

A database server. We’re going to be using MySQL server in this tutorial.
You’ll need to know enough about SQL in order to create a database, and run
SQL snippets from the tutorial. CakePHP will handle building all the queries
your application needs. Since we’re using MySQL, also make sure that you have
pdo_mysql enabled in PHP.

Basic PHP knowledge.

Before starting you should make sure that you have got an up to date PHP
version:

php -v

You should at least have got installed PHP 5.6.0 (CLI) or higher.
Your webserver’s PHP version must also be of 5.6.0 or higher, and
should be the same version your command line interface (CLI) PHP is.

The easiest way to install CakePHP is to use Composer. Composer is a simple way
of installing CakePHP from your terminal or command line prompt. First, you’ll
need to download and install Composer if you haven’t done so already. If you
have cURL installed, it’s as easy as running the following:

We can quickly check that our installation is correct, by checking the default
home page. Before you can do that, you’ll need to start the development server:

cd /path/to/our/app
bin/cake server

Note

For Windows, the command needs to be bin\cakeserver (note the backslash).

This will start PHP’s built-in webserver on port 8765. Open up
http://localhost:8765 in your web browser to see the welcome page. All the
bullet points should be green chef hats other than CakePHP being able to connect to
your database. If not, you may need to install additional PHP extensions, or set
directory permissions.