CakePHP 3 - Best Practice and Cookbook

Next: Batch/Cron Jobs with CakePHP 3 UP: TOC

This chapter show how to install CakePHP 3 and its components.

cd /usr/local/www/
mkdir my-app-topic
cd my-app-topic
curl -s https://getcomposer.org/installer | php
All settings correct for using Composer Downloading 1.1.0... Composer successfully installed to: /usr/local/www/my-app-topic/composer.phar Use it: php composer.phar php composer.phar create-project --prefer-dist cakephp/app vp3 Installing cakephp/app (3.2.6) - Installing cakephp/app (3.2.6) Loading from cache Created project in vp3 Loading composer repositories with package information Updating dependencies (including require-dev) - Installing aura/installer-default (1.0.0) Loading from cache - Installing cakephp/plugin-installer (0.0.15) Loading from cache - Installing psr/log (1.0.0) Loading from cache - Installing mobiledetect/mobiledetectlib (2.8.22) Loading from cache - Installing aura/intl (1.1.1) Loading from cache - Installing cakephp/chronos (0.4.9) Loading from cache - Installing cakephp/cakephp (3.2.8) Loading from cache - Installing symfony/yaml (v3.0.6) Loading from cache - Installing symfony/filesystem (v3.0.6) Loading from cache - Installing symfony/config (v3.0.6) Loading from cache - Installing symfony/polyfill-mbstring (v1.1.1) Loading from cache - Installing symfony/console (v3.0.6) Loading from cache - Installing robmorgan/phinx (v0.5.3) Loading from cache - Installing cakephp/migrations (1.5.8) Loading from cache - Installing jakub-onderka/php-console-color (0.1) Loading from cache - Installing jakub-onderka/php-console-highlighter (v0.3.2) Loading from cache - Installing dnoegel/php-xdg-base-dir (0.1) Loading from cache - Installing nikic/php-parser (v2.1.0) Loading from cache - Installing symfony/var-dumper (v3.0.6) Loading from cache - Installing psy/psysh (v0.7.2) Loading from cache - Installing jdorn/sql-formatter (v1.2.17) Loading from cache - Installing cakephp/debug_kit (3.2.8) Loading from cache - Installing cakephp/bake (1.2.4) Loading from cache cakephp/app suggests installing phpunit/phpunit (Allows automated tests to be run without system-wide install.) cakephp/app suggests installing cakephp/cakephp-codesniffer (Allows to check the code against the coding standards used in CakePHP.) symfony/console suggests installing symfony/event-dispatcher () symfony/console suggests installing symfony/process () symfony/var-dumper suggests installing ext-symfony_debug () psy/psysh suggests installing ext-pcntl (Enabling the PCNTL extension makes PsySH a lot happier :)) psy/psysh suggests installing ext-posix (If you have PCNTL, you'll want the POSIX extension as well.) psy/psysh suggests installing ext-readline (Enables support for arrow-key history navigation, and showing and manipulating command history.) psy/psysh suggests installing ext-pdo-sqlite (The doc command requires SQLite to work.) cakephp/debug_kit suggests installing ext-sqlite (DebugKit needs to store panel data in a database. SQLite is simple and easy to use.) Writing lock file Generating autoload files > Cake\Composer\Installer\PluginInstaller::postAutoloadDump > App\Console\Installer::postInstall Created `config/app.php` file Set Folder Permissions ? (Default to Y) [Y,n]? Y Permissions set on /usr/local/www.../vp3/tmp/cache Permissions set on /usr/local/www.../vp3/tmp/cache/models Permissions set on /usr/local/www..../vp3/tmp/cache/persistent Permissions set on /usr/local/www.../vp3/tmp/cache/views Permissions set on /usr/local/www.../vp3/tmp/sessions Permissions set on /usr/local/www.../vp3/tmp/tests Permissions set on /usr/local/www..../vp3/tmp Permissions set on /usr/local/www..../vp3/logs Updated Security.salt value in config/app.php #

After installation the directory structure looks as follows

ls -altr vp3 total 124 -rw-r--r-- 1 root wheel 1202 Apr 27 06:45 phpunit.xml.dist -rw-r--r-- 1 root wheel 648 Apr 27 06:45 index.php -rw-r--r-- 1 root wheel 1280 Apr 27 06:45 composer.json -rw-r--r-- 1 root wheel 1015 Apr 27 06:45 README.md -rw-r--r-- 1 root wheel 321 Apr 27 06:45 .travis.yml -rw-r--r-- 1 root wheel 140 Apr 27 06:45 .htaccess -rw-r--r-- 1 root wheel 41 Apr 27 06:45 .gitignore -rw-r--r-- 1 root wheel 772 Apr 27 06:45 .gitattributes -rw-r--r-- 1 root wheel 329 Apr 27 06:45 .editorconfig drwxr-xr-x 2 root wheel 512 May 13 11:47 bin drwxr-xrwx 2 root wheel 512 May 13 11:47 logs drwxr-xr-x 2 root wheel 512 May 13 11:47 plugins drwxr-xr-x 8 root wheel 512 May 13 11:47 src drwxr-xr-x 4 root wheel 512 May 13 11:47 tests drwxr-xrwx 5 root wheel 512 May 13 11:47 tmp drwxr-xr-x 5 root wheel 512 May 13 11:47 webroot drwxr-xr-x 6 root wheel 512 May 13 11:47 .. -rw-r--r-- 1 root wheel 43652 May 13 11:47 composer.lock drwxr-xr-x 11 root wheel 512 May 13 11:47 . drwxr-xr-x 15 root wheel 512 May 13 11:47 vendor drwxr-xr-x 3 root wheel 512 May 13 11:47 config Next: Batch/Cron Jobs with CakePHP 3 UP: TOC