XAMPP に CakePHP 3.6.2 を ;extension=intl でインストール


これは XAMPP という php の開発環境の上にフレームワークである CakePHP をインストールする物語です。




まずは、XAMPP です。Windows 向け XAMPP 7.2.6 を選択。



次にコンポーサーのインストール。コンポーサーとは Laravel や CakePHP をパーケージ管理してるツールらしい。





cd C:\xampp\htdocs




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


最後の cakephp の部分は C:\xampp\htdocs の下に作成されるフォルダ名です。



— エラー抜粋 —
Your requirements could not be resolved to an installable set of packages.

Problem 1 – cakephp/cakephp 3.6.5 requires ext-intl * -> the requested PHP extension intl is missing from your system. – cakephp/cakephp 3.6.4 requires ext-intl * -> the requested PHP extension intl is missing from your system. – cakephp/cakephp 3.6.3 requires ext-intl * -> the requested PHP extension intl is missing from your system. – cakephp/cakephp 3.6.2 requires ext-intl * -> the requested PHP extension intl is missing from your system. – cakephp/cakephp 3.6.1 requires ext-intl * -> the requested PHP extension intl is missing from your system. – cakephp/cakephp 3.6.0 requires ext-intl * -> the requested PHP extension intl is missing from your system. – Installation request for cakephp/cakephp 3.6.* -> satisfiable by cakephp/cakephp[3.6.0, 3.6.1, 3.6.2, 3.6.3, 3.6.4, 3.6.5].
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.
— 抜粋ここまで —


調べてみると、C:\xampp\php\php.ini ファイルを開き、extension の先頭の「;」を外して、intlを有効にする必要があるらしい。どうも以下のような設定を変更するらしいが、わたしの設定にはそんな項目がないのです。だれか助けてください。

;extension=php_intl.dll → extension=php_intl.dll

;extension=intl という似た項目があるのでとりあえず、「;」を外して保存してみた。


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



— エラー抜粋 —
[InvalidArgumentException] Project directory cakephp/ is not empty.
— 抜粋ここまで —

前回インストール時に作成された C:\xampp\htdocs\cakephp のフォルダを削除。


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




— インストール内容抜粋 —
Installing cakephp/app (3.6.2) – Installing cakephp/app (3.6.2): Loading from cache Created project in cakephp Loading composer repositories with package information Updating dependencies (including require-dev) Package operations: 48 installs, 0 updates, 0 removals – Installing cakephp/plugin-installer (1.1.0): Downloading (100%) – Installing aura/intl (3.0.0): Downloading (100%) – Installing psr/http-message (1.0.1): Loading from cache – Installing zendframework/zend-diactoros (1.7.2): Downloading (100%) – Installing psr/log (1.0.2): Loading from cache – Installing cakephp/chronos (1.1.4): Downloading (100%) – Installing cakephp/cakephp (3.6.5): Downloading (100%) – Installing symfony/polyfill-ctype (v1.8.0): Loading from cache – Installing symfony/yaml (v3.4.11): Downloading (100%) – Installing symfony/debug (v4.1.0): Loading from cache – Installing symfony/polyfill-mbstring (v1.8.0): Loading from cache – Installing symfony/console (v3.4.11): Downloading (100%) – Installing symfony/filesystem (v4.1.0): Loading from cache – Installing symfony/config (v3.4.11): Downloading (100%) – Installing robmorgan/phinx (v0.8.1): Downloading (100%) – Installing cakephp/migrations (1.8.1): Downloading (100%) – Installing m1/env (2.1.1): Downloading (100%) – Installing josegonzalez/dotenv (3.2.0): Downloading (100%) – Installing mobiledetect/mobiledetectlib (2.8.32): Downloading (100%) – Installing twig/twig (v1.35.3): Downloading (100%) – Installing umpirsky/twig-php-function (v0.1): Downloading (100%) – Installing jasny/twig-extensions (v1.2.0): Downloading (100%) – Installing asm89/twig-cache-extension (1.3.2): Downloading (100%) – Installing aptoma/twig-markdown (2.0.0): Downloading (100%) – Installing ajgl/breakpoint-twig-extension (0.3.1): Downloading (100%) – Installing wyrihaximus/twig-view (4.3.4): Downloading (100%) – Installing cakephp/bake (1.8.0): Downloading (100%) – Installing squizlabs/php_codesniffer (3.3.0): Downloading (100%) – Installing cakephp/cakephp-codesniffer (3.0.5): Downloading (100%) – Installing jdorn/sql-formatter (v1.2.17): Downloading (100%) – Installing symfony/process (v4.1.0): Loading from cache – Installing symfony/finder (v4.1.0): Loading from cache – Installing seld/phar-utils (1.0.1): Downloading (100%) – Installing seld/jsonlint (1.7.1): Downloading (100%) – Installing seld/cli-prompt (1.0.3): Downloading (100%) – Installing justinrainbow/json-schema (5.2.7): Downloading (100%) – Installing composer/spdx-licenses (1.4.0): Downloading (100%) – Installing composer/semver (1.4.2): Downloading (100%) – Installing composer/ca-bundle (1.1.1): Downloading (100%) – Installing composer/composer (1.6.5): Downloading (100%) – Installing cakephp/debug_kit (3.16.3): Downloading (100%) – Installing symfony/polyfill-php72 (v1.8.0): Loading from cache – Installing symfony/var-dumper (v4.1.0): Loading from cache – Installing nikic/php-parser (v4.0.2): 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 psy/psysh (v0.9.6): Loading from cache 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 dereuromark/cakephp-ide-helper (After baking your code, this keeps your annotations in sync with the code evolving from there on for maximum IDE and PHPStan compatibility.) cakephp/app suggests installing phpunit/phpunit (Allows automated tests to be run without system-wide install.) cakephp/cakephp suggests installing lib-ICU (The intl PHP library, to use Text::transliterate() or Text::slug()) symfony/console suggests installing symfony/event-dispatcher () symfony/console suggests installing symfony/lock () symfony/console suggests installing psr/log-implementation (For using the console logger) m1/env suggests installing m1/vars (For loading of configs) asm89/twig-cache-extension suggests installing psr/cache-implementation (To make use of PSR-6 cache implementation via PsrCacheAdapter.) aptoma/twig-markdown suggests installing michelf/php-markdown (Original Markdown engine with MarkdownExtra.) aptoma/twig-markdown suggests installing knplabs/github-api (Needed for using GitHub’s Markdown engine provided through their API.) ajgl/breakpoint-twig-extension suggests installing ext-xdebug (The Xdebug extension is required for the breakpoint to work) ajgl/breakpoint-twig-extension suggests installing symfony/framework-bundle (The framework bundle to integrate the extension into Symfony) ajgl/breakpoint-twig-extension suggests installing symfony/twig-bundle (The twig bundle to integrate the extension into Symfony) 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-pdo-sqlite (The doc command requires SQLite to work.) psy/psysh suggests installing hoa/console (A pure PHP readline implementation. You’ll want this if your PHP install doesn’t already support readline or libedit.) Writing lock file Generating autoload files > Cake\Composer\Installer\PluginInstaller::postAutoloadDump > App\Console\Installer::postInstall Created `config/app.php` file Created `C:\xampp\htdocs\cakephp/tmp/cache/views` directory Set Folder Permissions ? (Default to Y) [Y,n]?
— 抜粋ここまで —


ここでデフォルトは Y と書いてあるので、「Y」を入力しエンターキーを押す。








— エラー抜粋 —
Fatal error: You must enable the intl extension to use CakePHP.
in C:\xampp\htdocs\cakephp\config\requirements.php on line 31
— 抜粋ここまで —


調べてみると、また extension=php_intl.dll が問題らしい。
( だから、私の辞書にはその項目はないのだよ。) と独り言を言ってみた。


仕方がないので XAMPP を再起動。






なぜ extension=php_intl.dll の項目ない場合のソリューション情報がないのだ。バッサリ。