使用 Composer 安装 CodeIgniter 4 问题

6 php codeigniter

我在尝试通过 Composer 在本地服务器 (xampp) 上安装 CodeIgniter 4 时遇到问题

抛出我的代码如下:

    PS C:\Users\PuercoRico> cd D:\xampp\htdocs
PS D:\xampp\htdocs> composer create-project codeigniter4/appstarter ci4 -s rc
Installing codeigniter4/appstarter (4.0.0-rc.4)
  - Installing codeigniter4/appstarter (4.0.0-rc.4): Loading from cache
Created project in ci4
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
    - codeigniter4/framework v4.0.0-rc.3 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - codeigniter4/framework v4.0.0-rc.2.1 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - codeigniter4/framework v4.0.0-rc.2 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - codeigniter4/framework v4.0.0-rc.1 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - codeigniter4/framework 4.0.0-rc.4 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - Installation request for codeigniter4/framework ^4@rc -> satisfiable by codeigniter4/framework[4.0.0-rc.4, v4.0.0-rc.1, v4.0.0-rc.2, v4.0.0-rc.2.1, v4.0.0-rc.3].

  To enable extensions, verify that they are enabled in your .ini files:
    - D:\xampp\php\php.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
Run Code Online (Sandbox Code Playgroud)

我使用的 php 版本是 7.4.1

知道错误可能是什么或我如何解决它。

小智 30

您的 PHP 缺少intl扩展名。它对于格式化货币、数字和日期/时间以及符合 UCA 的排序规则、消息格式化和规范化文本等很有用。

查看 Codeignitor 4 [文档][1]:

按照步骤在 XAMPP 中安装它 -

  1. 打开 [xampp_folder_path]/php/php.ini 进行编辑。
  2. 搜索;extension=intl并删除; .
  3. 保存 php.ini 文件并重新启动 Apache。


Rif*_*zak 8

快速解决

  1. 打开 XAMPP 控制面板。
  2. Apache -> 选择配置并选择 PHP(php.ini)
  3. 搜索;extension=intl并删除;
  4. 保存更改

重新启动阿帕奇


Ahm*_*rif 8

对于 Ubuntu/Linux 和 nginx 在终端中写入以下命令

sudo apt-get install php-intl
 
Run Code Online (Sandbox Code Playgroud)