Today we are going to show you how to install CakePHP 3.0 on your Linux VPS. CakePHP is a rapid development PHP framework. It allows you to build web applications quickly without complex configurations. It is secure and licensed under the MIT license which makes it a very suitable framework for web developers.
In order to install CakePHP you need to make sure that your CentOS VPS meets the following requirements:
* LAMP is installed
* PHP 5.4.16 or higher is installed.
* PHP mbstring extension is loaded.
* PHP intl extension is loaded.
First, log in to your VPS via SSH and update your system software to the latest version with the following command:
Install PHP mbstring and intl extensions using the command:
Now, to manage the CakePHP dependencies you need to download and install composer. You can accomplish this by executing the following commands:
Also, you need to create a database, a database user and set up a password for your first CakePHP project. Log in to your MySQL as root:
and execute the following commands:
You can replace ‘app_db’, ‘app_user’ and ‘YoUrPaS$w0rD’ to match your needs.
Next, navigate to /var/www/html and create your first CakePHP project.
To create your first CakePHP project you need to execute the following command:
You can replace ‘CakePHPApp’ to match the name of your first CakePHP project. You should wait no longer than one minute for your project to be ready. Then, change the ownership of the files and make Apache to be the owner using the following command:
Now, edit the ‘app.php’ configuration file:
Find the datasources section and change the ‘host’, ‘username’, ‘password’ and ‘database’ to match yours.
It is time to configure Apache. Edit your Apache configuration file:
Add the following lines at the end of the file:
Restart Apache:
That’s it. You have successfully installed CakePHP 3.0 on your CentOS VPS. Open your favorite web browser and navigate to:
The official CakePHP documentation is available at:
Of course you don’t have to do any of this if you use one of our Linux VPS hosting services, in which case you can simply ask our expert Linux admins to install CakePHP for you. They are available 24×7 and will take care of your request immediately.
PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. And don’t forget to check out our CakePHP hosting plans. Thanks.