PHP-INTL on Ubuntu for CakePHP 3 and PHP 7
I opted for CakePHP version 3 for a new project I am working on. Before starting the project I thought I would play around with the framework a bit. I chose Composer as the installation method. I ran the following command build a project called ctest.
composer create-project –prefer-dist cakephp/app ctest
I recieved the following errors and feedback.
Installing cakephp/app (3.3.3)
- Installing cakephp/app (3.3.3)
Downloading: 100%
Created project in ctest
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.3.8 requires ext-intl \* -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.3.7 requires ext-intl \* -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.3.6 requires ext-intl \* -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.3.5 requires ext-intl \* -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.3.4 requires ext-intl \* -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.3.3 requires ext-intl \* -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.3.2 requires ext-intl \* -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.3.1 requires ext-intl \* -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.3.0-beta3 requires ext-intl \* -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.3.0-beta2 requires ext-intl \* -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.3.0-beta requires ext-intl \* -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.3.0-RC1 requires ext-intl \* -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.3.0 requires ext-intl \* -> the requested PHP extension intl is missing from your system.
- Installation request for cakephp/cakephp 3.3.\* -> satisfiable by cakephp/cakephp\[3.3.0, 3.3.0-RC1, 3.3.0-beta, 3.3.0-beta2, 3.3.0-beta3, 3.3.1, 3.3.2, 3.3.3, 3.3.4, 3.3.5, 3.3.6, 3.3.7, 3.3.8\].
To enable extensions, verify that they are enabled in those .ini files:
- /etc/php/7.0/cli/php.ini
- /etc/php/7.0/cli/conf.d/10-mysqlnd.ini
- /etc/php/7.0/cli/conf.d/10-opcache.ini
- /etc/php/7.0/cli/conf.d/10-pdo.ini
- /etc/php/7.0/cli/conf.d/15-xml.ini
- /etc/php/7.0/cli/conf.d/20-calendar.ini
- /etc/php/7.0/cli/conf.d/20-ctype.ini
- /etc/php/7.0/cli/conf.d/20-curl.ini
- /etc/php/7.0/cli/conf.d/20-dom.ini
- /etc/php/7.0/cli/conf.d/20-exif.ini
- /etc/php/7.0/cli/conf.d/20-fileinfo.ini
- /etc/php/7.0/cli/conf.d/20-ftp.ini
- /etc/php/7.0/cli/conf.d/20-gd.ini
- /etc/php/7.0/cli/conf.d/20-gettext.ini
- /etc/php/7.0/cli/conf.d/20-iconv.ini
- /etc/php/7.0/cli/conf.d/20-json.ini
- /etc/php/7.0/cli/conf.d/20-mbstring.ini
- /etc/php/7.0/cli/conf.d/20-mcrypt.ini
- /etc/php/7.0/cli/conf.d/20-mysqli.ini
- /etc/php/7.0/cli/conf.d/20-pdo\_mysql.ini
- /etc/php/7.0/cli/conf.d/20-phar.ini
- /etc/php/7.0/cli/conf.d/20-posix.ini
- /etc/php/7.0/cli/conf.d/20-readline.ini
- /etc/php/7.0/cli/conf.d/20-shmop.ini
- /etc/php/7.0/cli/conf.d/20-simplexml.ini
- /etc/php/7.0/cli/conf.d/20-soap.ini
- /etc/php/7.0/cli/conf.d/20-sockets.ini
- /etc/php/7.0/cli/conf.d/20-sysvmsg.ini
- /etc/php/7.0/cli/conf.d/20-sysvsem.ini
- /etc/php/7.0/cli/conf.d/20-sysvshm.ini
- /etc/php/7.0/cli/conf.d/20-tokenizer.ini
- /etc/php/7.0/cli/conf.d/20-wddx.ini
- /etc/php/7.0/cli/conf.d/20-xmlreader.ini
- /etc/php/7.0/cli/conf.d/20-xmlwriter.ini
- /etc/php/7.0/cli/conf.d/20-xsl.ini
You can also run \`php --ini\` inside terminal to see which files are used by PHP in CLI mode.
I resolved all of these by installing one extension; intl (Internationalization Functions).
sudo apt-get install php-intl
Once php-intl has been installed I removed the the ctest directory and reinstalled with the following feedback.
sudo rm -fR ctest
composer create-project --prefer-dist cakephp/app ctest
Installing cakephp/app (3.3.3)
- Installing cakephp/app (3.3.3)
Loading from cache
Created project in ctest
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing aura/installer-default (1.0.0)
Downloading: 100%
- Installing cakephp/plugin-installer (0.0.15)
Downloading: 100%
- Installing cakephp/chronos (1.0.0)
Downloading: 100%
- Installing mobiledetect/mobiledetectlib (2.8.24)
Downloading: 100%
- Installing psr/http-message (1.0.1)
Downloading: 100%
- Installing zendframework/zend-diactoros (1.3.7)
Downloading: 100%
- Installing psr/log (1.0.0)
Loading from cache
- Installing aura/intl (1.1.1)
Downloading: 100%
- Installing cakephp/cakephp (3.3.8)
Downloading: 100%
- Installing symfony/yaml (v3.1.6)
Downloading: 100%
- Installing symfony/debug (v3.1.6)
Loading from cache
- Installing symfony/polyfill-mbstring (v1.3.0)
Downloading: 100%
- Installing symfony/console (v3.1.6)
Downloading: 100%
- Installing symfony/filesystem (v3.1.6)
Downloading: 100%
- Installing symfony/config (v3.1.6)
Downloading: 100%
- Installing robmorgan/phinx (v0.5.3)
Downloading: 100%
- Installing cakephp/migrations (1.6.3)
Downloading: 100%
- Installing jakub-onderka/php-console-color (0.1)
Downloading: 100%
- Installing jakub-onderka/php-console-highlighter (v0.3.2)
Downloading: 100%
- Installing dnoegel/php-xdg-base-dir (0.1)
Downloading: 100%
- Installing nikic/php-parser (v2.1.1)
Downloading: 100%
- Installing symfony/var-dumper (v3.1.6)
Downloading: 100%
- Installing psy/psysh (v0.7.2)
Downloading: 100%
- Installing jdorn/sql-formatter (v1.2.17)
Downloading: 100%
- Installing cakephp/debug\_kit (3.4.1)
Downloading: 100%
- Installing cakephp/bake (1.2.8)
Downloading: 100%
cakephp/app suggests installing markstory/asset\_compress (An asset compression plugin which provides file concatenation and a flexible filter system for preprocessing and minification.)
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-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 /var/www/ctest/tmp/cache
Permissions set on /var/www/ctest/tmp/cache/models
Permissions set on /var/www/ctest/tmp/cache/persistent
Permissions set on /var/www/ctest/tmp/cache/views
Permissions set on /var/www/ctest/tmp/sessions
Permissions set on /var/www/ctest/tmp/tests
Permissions set on /var/www/ctest/tmp
Permissions set on /var/www/ctest/logs
Updated Security.salt value in config/app.php