[英]The requested PHP extension intl is missing from your system (SonataAdminBundle) in Symfony2
I try to install the sandbox but I get the following error from composer:我尝试安装沙箱,但从 Composer 收到以下错误:
Loading composer repositories with package information Installing dependencies from lock file Your requirements could not be resolved to an installable set of packages.使用包信息加载 Composer 存储库 从锁定文件安装依赖项 您的要求无法解析为一组可安装的包。
Problem 1问题一
- Installation request for sonata-project/intl-bundle 2.1.0 -> satisfiable by sonata-project/intl-bundle 2.1.0.`
- sonata-project/intl-bundle 2.1.0 requires ext-intl * -> the requested PHP extension intl is missing from your system.`
Problem 2问题二
- sonata-project/intl-bundle 2.1.0 requires ext-intl * -> the requested PHP extension intl is missing from your system.`
- sonata-project/news-bundle 2.1.x-dev requires sonata-project/intl-bundle 2.1.* -> satisfiable by sonata-project/intl-bundle 2.1.0.
- Installation request for sonata-project/news-bundle 2.1.
Linux用户
yum install php-intl
I had the same problem while I was installing new Magento 2.0, after different hit and trials, I manged to solve it by following these steps:我在安装新的 Magento 2.0 时遇到了同样的问题,经过不同的尝试和试验,我设法按照以下步骤解决了这个问题:
I copied all icu* files from php directory to Appache directory, and it worked.我将所有icu*文件从 php 目录复制到 Appache 目录,并且它工作正常。
Php direcotry: PHP目录:
WAMP\\bin\\php\\php5.5.12 WAMP\\bin\\php\\php5.5.12
Appache Directory:应用目录:
WAMP\\bin\\apache\\apache2.4.9 WAMP\\bin\\apache\\apache2.4.9
Make sure to un-comment following line in php.ini file:确保取消注释 php.ini 文件中的以下行:
extension=ext/php_intl.dll扩展=ext/php_intl.dll
Like @Hugehornet pointed out - you should enable this extension in php.ini by uncommenting this line: extension=ext/php_intl.dll
就像@Hugehornet指出的那样 - 你应该通过取消注释这一行来在php.ini 中启用这个扩展: extension=ext/php_intl.dll
If you use wamp's interface for this task you are actually updating the php.ini file located in apache's directory.如果您为此任务使用 wamp 的界面,您实际上是在更新位于 apache 目录中的php.ini文件。
Example: C:\\wamp\\bin\\apache\\Apache2.4.4\\bin\\php.ini示例:C:\\wamp\\bin\\apache\\Apache2.4.4\\bin\\php.ini
Composer is using the one located in the php's installation directory. Composer 正在使用位于 php 安装目录中的那个。
Example: C:\\wamp\\bin\\php\\php5.4.12\\php.ini示例:C:\\wamp\\bin\\php\\php5.4.12\\php.ini
You should manually edit the latter and restart the wamp server.您应该手动编辑后者并重新启动 wamp 服务器。
You need to enable the intl extension in php just as the error says.正如错误所说,您需要在 php 中启用 intl 扩展。 In your php.ini file, uncomment the line extension=ext/php_intl.dll
or something like this.在 php.ini 文件中,取消注释extension=ext/php_intl.dll
或类似内容。
Edit : note that if you are using wamp or something like this, you should be aware of the fact that the php.ini file in the wamp config is not necessarily the one used by composer.编辑:请注意,如果您使用 wamp 或类似的东西,您应该意识到 wamp 配置中的 php.ini 文件不一定是 Composer 使用的文件。
First of all be sure that your server is isung x86 build (intl not working with x64), then:首先确保您的服务器是 isung x86 构建(intl 不适用于 x64),然后:
php.ini
directly直接在php.ini
激活 intl 扩展icu*.dll
form php directory to apache directory将所有icu*.dll
表单php目录复制到apache目录 In my windows system I have two php.ini
files at the flowing paths:在我的 Windows 系统中,我在流动路径中有两个php.ini
文件:
C:\wamp\bin\php\phpx.y.z
C:\wamp\bin\apache\Apachex.y.z\bin
I don't know which one is in your path.我不知道你的路径是哪一个。 Just make sure to add the extension in both of them to eliminate any doubt.只需确保在它们两个中添加扩展名即可消除任何疑问。
I am on a Mac OS X Yosemite, and I fix this error我在 Mac OS X Yosemite 上,我修复了这个错误
the requested PHP extension mcrypt is missing from your system您的系统中缺少请求的 PHP 扩展 mcrypt
by running the following commands :通过运行以下命令:
brew update
brew upgrade
brew tap homebrew/dupes
brew tap josegonzalez/homebrew-php
brew install php54-mcrypt
If intl has already been enabled and it doesn't works, add your PHP directory in the Path environment variable, then restart your server.如果已经启用了 intl 并且它不起作用,请在 Path 环境变量中添加您的 PHP 目录,然后重新启动您的服务器。 (for example C:\\Program Files\\wamp\\bin\\php\\phpX.XXX.XXX for wamp) (例如 C:\\Program Files\\wamp\\bin\\php\\phpX.XXX.XXX 表示 wamp)
It has worked for me!它对我有用!
On Ubuntu, Debian, and related Linux distributions在 Ubuntu、Debian 和相关的 Linux 发行版上
sudo apt-get install php-intl
to install the extension for the default PHP version.安装默认 PHP 版本的扩展。 For other versions a variation like apt-get install php7.3-intl
will choose the correct extension if the version provided is correct.对于其他版本,如果提供的版本正确,像apt-get install php7.3-intl
这样的变体将选择正确的扩展名。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.