如何使用 composer 创建蛋糕 php 项目

How to create cake php project using composer

作为 CakePHP 的新手,我不明白如何使用 composer 创建项目文件夹。我尝试 运行 使用 composer 安装,但显示错误。

Installing cakephp/app (3.0.3)
- Installing cakephp/app (3.0.3)
Loading from cache

Created project in C:\xampp\htdocs\cphp\app Loading composer
repositories with package information Installing dependencies
(including require-dev) Your requirements could not be resolved to an
installable set of packages.

Problem 1
- cakephp/cakephp 3.0.x-dev requires ext-intl * -> the requested PHP extensi on intl is missing from your system.
- cakephp/cakephp 3.1.x-dev requires ext-intl * -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.0.6 requires ext-intl * -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.0.5 requires ext-intl * -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.0.4 requires ext-intl * -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.0.3 requires ext-intl * -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.0.2 requires ext-intl * -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.0.1 requires ext-intl * -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.0.0-beta3 requires ext-intl * -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.0.0-beta2 requires ext-intl * -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.0.0-beta1 requires ext-intl * -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.0.0-alpha2 requires ext-intl * -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.0.0-alpha1 requires ext-intl * -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.0.0-RC2 requires ext-intl * -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.0.0-RC1 requires ext-intl * -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.0.0 requires ext-intl * -> the requested PHP extension intl is missing from your system.
- Installation request for cakephp/cakephp ~3.0 -> satisfiable by cakephp/ca kephp[3.0.0, 3.0.0-RC1, 3.0.0-RC2, 3.0.0-alpha1,
3.0.0-alpha2, 3.0.0-beta1, 3.0. 0-beta2, 3.0.0-beta3, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.0.6, 3.1.x-dev, 3.0.x-dev].

错误消息几乎说明了一切:

The requested PHP extension intl is missing from your system.

所有 Cake 3.x 版本都需要此模块,这就是它重复这么多次的原因(所有不同版本都显示相同的问题)。

默认情况下,XAMPP(您似乎正在使用)随附,但可能未启用。使用记事本等文本编辑器打开 C:\xampp\php\php.ini,然后取消注释(删除开头的分号)加载 intl 扩展名的行,因此它只显示:extension=php_intl.dll.

之后再试一次,Composer 应该会继续检查您的系统并安装 Cake 或抛出任何其他问题。