php CodeIgniter 4与composer一起安装时出现问题

qzwqbdag  于 2022-12-02  发布在  PHP
关注(0)|答案(6)|浏览(169)

我在尝试通过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
你知道是什么错误或者我怎么修复它吗?

ukqbszuj

ukqbszuj1#

您的PHP缺少intl扩展名。它对于格式化货币、数字和日期/时间以及符合UCA的排序规则、格式化消息和规范文本等非常有用。
查看代码触发器4 [文档][1]:
按照以下步骤在XAMPP中安装它-
1.打开[xampp文件夹路径]/php/php.ini进行编辑。
1.搜索**;扩展名=intl并删除;**.
1.保存php.ini文件并重新启动Apache。

k2fxgqgv

k2fxgqgv2#

快速修复
1.打开XAMPP控制面板。

  1. Apache -〉选择配置和选择PHP(php.ini)
    1.搜索**;扩展名=intl并删除;**.
    1.保存变更
    重新启动Apache
5q4ezhmt

5q4ezhmt3#

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

sudo apt-get install php-intl
icnyk63a

icnyk63a4#

您缺少用于PHP的intl extension

  • ubuntu 20.04和带有Apache webserverPHP 7.4上,尝试:
sudo apt-get install php7.4-intl
sudo service apache2 restart
  • 在带有Apache webserverubuntu 20.04PHP 8.0上,尝试:
sudo apt-get install php8.0-intl
sudo service apache2 restart
  • 在带有Nginx webserverubuntu 20.04PHP 7.4上,尝试:
sudo apt-get install php7.4-intl
sudo systemctl reload nginx
  • ubuntu 20.04PHP 8.0Nginx webserver上,请尝试:
sudo apt-get install php8.0-intl
sudo systemctl reload nginx
jgovgodb

jgovgodb5#

1.操作XAMPP控制面板
1.单击与Apache服务相关的Config按钮
1.然后单击PHP(php.ini)
1.打开php.ini文件并查找(CTRL+F)扩展名=intl
1.默认情况下,该行显示为***;extension=intl***
1.删除**;**从行并保存文件
1.重新启动Apache服务器

qcuzuvrc

qcuzuvrc6#

对于使用的fedora发行版

sudo dnf install php-intl

相关问题