【问题标题】:CodeIgniter 4 problem installing with composerCodeIgniter 4 使用作曲家安装的问题
【发布时间】:2021-11-08 23:07:05
【问题描述】:

我在尝试通过 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.

我使用的php版本是7.4.1

知道错误可能是什么或如何修复它。

【问题讨论】:

  • 错误信息告诉你问题是什么以及如何解决它。
  • requires ext-intl * -> the requested PHP extension intl is missing from your system - 哪些问题仍然悬而未决?您是否尝试过任何方法来解决此问题?

标签: php codeigniter


【解决方案1】:

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

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

按照步骤在 XAMPP 中安装它 -

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

【讨论】:

【解决方案2】:

快速修复

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

重启 Apache

【讨论】:

    【解决方案3】:

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

    sudo apt-get install php-intl
     
    

    【讨论】:

    • 也适用于 Apache。只需要重新启动 Apache。
    【解决方案4】:

    你错过了 PHP 的 intl extension 所以,

    • ubuntu 20.04PHP 7.4 上使用Apache webserver 试试:
    sudo apt-get install php7.4-intl
    sudo service apache2 restart
    
    • ubuntu 20.04PHP 8.0 上使用Apache webserver 试试:
    sudo apt-get install php8.0-intl
    sudo service apache2 restart
    
    • ubuntu 20.04PHP 7.4 上使用Nginx webserver 试试:
    sudo apt-get install php7.4-intl
    sudo systemctl reload nginx
    
    • ubuntu 20.04PHP 8.0 上使用Nginx webserver 试试:
    sudo apt-get install php8.0-intl
    sudo systemctl reload nginx
    

    【讨论】:

      猜你喜欢
      • 2020-07-27
      • 2016-01-01
      • 2017-11-24
      • 2013-06-21
      • 2013-06-03
      • 2013-06-10
      • 2017-10-19
      • 2014-02-25
      相关资源
      最近更新 更多