Install CakePHP 3 using Composer

In this tutorial we will guide you how to Install CakePHP 3 Using Composer step by step. CakePHP uses Composer, a dependency management tool, as the officially supported method for installation. Through Composer it’s simple and easy to install CakePHP.

Install CakePHP 3 Using Composer

#1. Requirements

Before Install CakePHP 3 make sure following requirements are enabled and installed on your machine:

1) You must have PHP 5.5.9 or greater.
2) mbstring extension and intl extension must be enabled. Make sure these lines are enable by removing the semicolon (;) from the start in php.ini file.

Note: If you installed latest version of XAMPP (7.2.1 or more), then you need to remove comment only from the below line in php.ini file.

extension=intl

extension=php_intl.dll
extension=php_mbstring.dll

#2. Install Composer

The next thing you need to do Install Composer On Windows With XAMPP. This process will take another 5-10 minutes. Below is the step by step tutorial:

How to Install Composer On Windows With XAMPP

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-terminal

Go to htdocs directory on your XAMPP server to Install CakePHP 3

htdocs directroy

Now Run the following command to install CakePhp 3 using Composer on your server in cakeapp folder in this C:\xampp\htdocs\cakeapp\ path.

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

run composer command

Once CakePhp 3 installation start then you will get following response like in the below image.

composer command

Once you successfully installed CakePhp 3 on your machine then you will get following response like in the below image.

cakephp installed

Finally it will ask you to set Folder Permission, so press Y to continue.

#3. Configuration Database

Configuration database details in config/app.php file.

'Datasources' => [
        'default' => [
            'className' => 'Cake\Database\Connection',
            'driver' => 'Cake\Database\Driver\Mysql',
            'persistent' => false,
            'host' => 'localhost',
            'username' => 'root',
            'password' => '',
            'database' => 'cakeapp',
            'encoding' => 'utf8',
            'timezone' => 'UTC',
            'flags' => [],
            'cacheMetadata' => true,
            'log' => false,
            'quoteIdentifiers' => false,
            'url' => env('DATABASE_URL', null),
        ],
    ]
9 Comments
  1. Loganathan says

    Thanks Dude

  2. bhawani singh says

    nice article …
    working fine
    thanks bro

    1. Vikas Kumar says

      you’re welcome.

  3. Deepak says

    Hello Sir,

    facing this problem

    Installing cakephp/app (3.7.1)
      - Installing cakephp/app (3.7.1): Loading from cache
    Created project in cakeapp
    Loading composer repositories with package information
    Updating dependencies (including require-dev)
    Your requirements could not be resolved to an installable set of packages.
    
      Problem 1
        - cakephp/cakephp 3.7.3 requires ext-intl * -> the requested PHP extension intl is missing from your system.
        - cakephp/cakephp 3.7.2 requires ext-intl * -> the requested PHP extension intl is missing from your system.
        - cakephp/cakephp 3.7.1 requires ext-intl * -> the requested PHP extension intl is missing from your system.
        - cakephp/cakephp 3.7.0 requires ext-intl * -> the requested PHP extension intl is missing from your system.
        - Installation request for cakephp/cakephp 3.7.* -> satisfiable by cakephp/cakephp[3.7.0, 3.7.1, 3.7.2, 3.7.3].
    
      To enable extensions, verify that they are enabled in your .ini files:
        - C:\xampp\php\php.ini
      You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
    
    1. Vikas Kumar says

      Hello Deepak,
      Removed comment from the below line in php.ini file to resolve this error:
      extension=intl

  4. bhawani singh says

    thanks bro….
    very good article

  5. Pramod says

    Thank you.

  6. Pete Nyandeh says

    Hi, Vikas.
    I am having the same problem, I removed the comment, eg:
    ;extension=php_gmp.dll
    extension=php_intl.dll
    ;extension=php_imap.dll
    ;extension=php_interbase.dll
    ;extension=php_ldap.dll
    extension=php_mbstring.dll
    ;extension=php_ming.dll

    And getting this error: Problem 1
    – cakephp/cakephp 3.8.2 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    – cakephp/cakephp 3.8.1 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    – cakephp/cakephp 3.8.0 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    – Installation request for cakephp/cakephp 3.8.* -> satisfiable by cakephp/cakephp[3.8.0, 3.8.1, 3.8.2].

    I am using XAMP 7.2.21 on Mac.

  7. garima says

    Notice (1024): Please change the value of ‘Security.salt’ in ROOT/config/app.php to a salt value specific to your application. [CORE\src\Error\Debugger.php, line 966]

Leave A Reply

Your email address will not be published.