Please support us by disabling ad blocker for smarttutorials.net ...

Install CakePHP 3 using Composer

Posted by & filed under CakePHP, PHP.

Installation of CakePHP 3 somewhat tricky/difficult for newbies. I will give you step by step instructions to install CakePHP 3 on your machine successfully, All you need to do is just follow this tutorial.

Install CakePHP 3 using Composer

Before starting CakePHP 3 installation step by step instructions, Please ensure following things are enabled and installed on your machine.

 

  1. You must have PHP 5.4.16 or above installed on your machine.
  2. mbstring extension and intl extension must be enabled to install CakePHP 3 on your machine.

 

For XAMPP users, intl extension is installed, but you need to enable extension by uncommenting the following line extension=php_intl.dll in the php.ini file. Once you uncomment the extension=php_intl.dll, then you must restart apache server using XAMPP control panel.
(Note: php.ini file mostly in the following directory C:\xampp\php)

 

For WAMP users, the intl extension is “activated” by default. But to make it work you have to go to php folder (by default) C:\wamp\bin\php\php{version}, copy all the files that looks like icu*.dll and paste them into the Apache bin directory C:\wamp\bin\apache\apache{version}\bin. Once you done please restart Apache server.

 

Installing CakePHP 3:

CakePHP 3 uses Composer to install, its dependency components, and does some automatic configuration work for you. So to install CakePHP 3 you must have Composer installed on your machine.

Composer Installation for CakePHP 3:

Composer Installation for windows users is very easy. All you need to do is just download .exe installer file from the Composer site.

Here is the .exe installer link to download Composer-Setup.exe

You can also install the Composer using curl using following command

curl -s https://getcomposer.org/installer | php

Once you successfully installed the Composer, then type composer and press enter in the terminal you will get following response like in the below image.

Composer Installation

Install CakePHP 3 using Composer

Before start to download CakePHP 3 using Composer, You must be in htdocs/www folder to start CakePHP 3 download. So change the directory in the terminal using cd command .

cd C:\xampp\htdocs
CakePHP 3 installation step by step

Now run the following command using your terminal window.

composer create-project --prefer-dist cakephp/app cquiz

It will takes sometime if you installing CakePHP first time using Composer. Second time onwards it takes from cache.

CakePHP 3 Installation Step by StepFinal Success image.

CakePHP 3 Installation Step by Step

 

Finally it will ask you to set permission for temp directory and to generate security salt. So please give Y to set the permission and generate security salt.

Now you successfully installed CakePHP 3 on your machine. So go the following URL on your browser to see CakePHP default home page like this.

CakePHP 3 installation step by step

Finally to add database credentials edit app.php file in the config directory(line no. 200 )

'Datasources' => [
        'default' => [
            'className' => 'Cake\Database\Connection',
            'driver' => 'Cake\Database\Driver\Mysql',
            'persistent' => false,
            'host' => 'localhost',
            'username' => 'root',
            'password' => '',
            'database' => 'smart_quiz',
            'encoding' => 'utf8',
            'timezone' => 'UTC',
            'cacheMetadata' => true,
            'quoteIdentifiers' => false,

          
        ]
]

 

Download Premium Only Scripts & 80+ Demo scripts Instantly at just 1.95 USD per month + 10% discount to all Exclusive Scripts

If you want any of my script need to be customized according to your business requirement,

Please feel free to contact me [at] muni[at]smarttutorials.net

Note: But it will be charged based on your customization requirement

Get Updates, Scripts & Other Useful Resources to your Email

Join 10,000+ Happy Subscribers on feedburner. Click to Subscribe (We don't send spam)
Every Email Subsciber could have access to download 100+ demo scripts & all future scripts.

Get Instant Script Download Access!