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

  1. MacOS
  2. Login as an administrator on terminal
  3. PHP version 5.6 or higher
  4. PHP mbstring extension
  5. PHP intl extension
  6. Composer

Installation

Installation includes following steps.

1) Install CakePHP using Composer

Run the following command to install CakePHP using composer.

  1. $ composer self-update && composer create-project -prefer-distcakephp/app javatpoint  

How to install CakePHP on MacOS

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.

  1. $ vi /etc/apache2/httpd.conf   

Locate the following code in the file

  1.    
  2. Options Indexes FollowSymLinks  
  3. AllowOverride None  
  4. Require all granted  
  5.   

And replace it with the following code.

  1.   
  2. Options Indexes FollowSymLinks  
  3. AllowOverride All  
  4. Require all granted  
  5.   

3) Restart the server.

We need to restart the server now. For this purpose, use the following command.

  1. $ sudoapachectl restart  

4) Run the CakePHP Server

Change the current working directory to the installation directory of CakePHP by using following command.

  1. $ cd /Library/WebServer/Documents/javatpoint/bin   

To access CakePHP on browser through localhost, we need to run the server by using following command.

  1. $ ./cake server  

How to install CakePHP on MacOS

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.

How to install CakePHP on MacOS

Hence, we have successfully installed and get started with CakePPHP version 3.5.10.



Contact Us logo Whatsapp