CakePHP 3.0 安装:系统中缺少 intl 扩展 [英] CakePHP 3.0 installation: intl extension missing from system
问题描述
使用 CakePHP 文档,我尝试使用 Composer 安装 3.0-beta2,但出现此错误:
Using the CakePHP docs, I am trying to install 3.0-beta2 using composer but I got this error:
cakephp/cakephp 3.0.x-dev 需要 ext-intl * ->您的系统中缺少请求的 PHP 扩展 intl
但是,我确定安装了 intl(它显示在 phpinfo 上).我使用的是 PHP 5.4.33/Apache 2.4.10.1
However, I know for sure that intl is installed (it shows on phpinfo). I'm using PHP 5.4.33/Apache 2.4.10.1
推荐答案
我今天遇到了同样的问题.您需要在 PHP 配置 (.ini
) 中启用 intl PHP 扩展.
I faced the same problem today. You need to enable the intl PHP extension in your PHP configuration (.ini
).
解决方案 Xampp (Windows)
- 打开
/xampp/php/php.ini
- 将
;extension=php_intl.dll
改为extension=php_intl.dll
(去掉分号) - 将所有
/xampp/php/ic*.dll
文件复制到/xampp/apache/bin
- 在 Xampp 控制面板中重启 apache
- Open
/xampp/php/php.ini
- Change
;extension=php_intl.dll
toextension=php_intl.dll
(remove the semicolon) - Copy all the
/xampp/php/ic*.dll
files to/xampp/apache/bin
- Restart apache in the Xampp control panel
解决方案 Linux(感谢 Annamalai Somasundaram)
Solution Linux (thanks to Annamalai Somasundaram)
安装 php5-intl 扩展
sudo apt-get install php5-intl
1.1.如果您使用的是 CentOS 或 Fedora,或者使用 sudo yum install php5-intl
.
1.1. Alternatively use sudo yum install php5-intl
if you are on CentOS or Fedora.
重启apache sudo service apache2 restart
解决方案 Mac/OSX(自制软件)(感谢 deizel)
Solution Mac/OSX (homebrew) (thanks to deizel)
- 安装 php5-intl 扩展
brew install php56-intl
- 如果你得到
没有可用的 php56-intl 公式
按照 这些说明. - 重启apache
sudo apachectl restart
- Install the php5-intl extension
brew install php56-intl
- If you get
No available formula for php56-intl
follow these instructions. - Restart apache
sudo apachectl restart
最终你可以运行 composer install
来检查它是否工作.否则会报错.
Eventually you can run composer install
to check if it's working. It will give an error if it's not.
这篇关于CakePHP 3.0 安装:系统中缺少 intl 扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!