How to install CakePHP on MacOS
Introduction
CakePHP is an open source web framework which follows Model-View-Controller approach. It is written in PHP and distributed under the MIT license. It was started by a Polish programmer Michal Tatarynowicz in April, 2005. Its first version was released in May, 2006. In this tutorial, we will install CakePHP on MacOS.
In this tutorial, we will install Zend framework on our MacOS.
Prerequisites
- MacOS
- Login as an administrator on terminal
- PHP version 5.6 or higher
- PHP mbstring extension
- PHP intl extension
- Composer
Installation
Installation includes following steps.
1) Install CakePHP using Composer
Run the following command to install CakePHP using composer.
This will install CakePHP on location /Library/WebServer/Documents
2) Configure Apache
Run the following command to open the configuration file of Apache in editor.
Locate the following code in the file
And replace it with the following code.
3) Restart the server.
We need to restart the server now. For this purpose, use the following command.
4) Run the CakePHP Server
Change the current working directory to the installation directory of CakePHP by using following command.
To access CakePHP on browser through localhost, we need to run the server by using following command.
It will start the CakePHP server which is listening on the port 8765.
5) Access on browser
To access CakePHP on browser, we type localhost:8765 in browser’s search bar.
Hence, we have successfully installed and get started with CakePPHP version 3.5.10.