Requirements:-

PHP 5.5.9 or greater (including PHP 7). PHP mbstring extension PHP intl extension MySQL (5.1.10 or greater)

Step 1 – Install LAMP Server

You can skip this step for the system having LAMP setup already. If you don’t have LAMP installed on your system proceed with the following commands to Setup LAMP on your Linux Server.

Step 2 – Install Composer

Now CakePHP is using composer for managing dependencies. So first we need to install Composer using following command on the system. If already installed then just update to latest version. Install Composer: Update Composer:

Step 3 – Create CakePHP 3 Application

After installing the composer on your system. Let’s create CakePHP application named “MyApp” using composer command as below.

Now set the proper permission for your project files. For Debian based system Apache default uses www-data as the user. So change files ownership as per your setup.

Step 4 – Setup Database for CakePHP

For this article, we are using MySQL as the database server. First use following commands to create a MySQL database and create.

Now edit config/app.php configuration file and search for your database setting. Make necessary changes as per below details Here, you have two options to run your CakePHP application. For development system follow the Step 5(A) and for Production deployment follow step 5(B).

Step 5(A) – Deploy CakePHP on Development System

First is to use its built-in web server preferred for development purpose installation. This will make your application available at http://host:port. From the app directory, execute: By default, without any arguments provided, this will serve your application at http://localhost:8765/. You can also specify your own host and port like below This will serve your application at http://192.168.10.123:1234/

Step 5(B) – Deploy CakePHP on Production System

Second is deploy with external web servers like Apache its preferred for production use. Let’s create an Apache VirtualHost configuration file using the following content. Change the ServerName and document root as per your setup. After that reload your Apache service and access your CakePHP like http://cakephp.example.com.

How to Install CakePHP on Debian 9  Stretch    TecAdmin - 33How to Install CakePHP on Debian 9  Stretch    TecAdmin - 58How to Install CakePHP on Debian 9  Stretch    TecAdmin - 68