简体   繁体   English

Symfony2 中您的系统 (SonataAdminBundle) 中缺少请求的 PHP 扩展 intl

[英]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),然后:

  • activate intl extension in php.ini directly直接在php.ini激活 intl 扩展
  • copy all icu*.dll form php directory to apache directory将所有icu*.dll表单php目录复制到apache目录
  • make sure your console using the same php folder you just configured source .确保您的控制台使用与您刚刚配置source相同的 php 文件夹。

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.

相关问题 PHP | “您的系统缺少请求的 PHP 扩展名 bcmath。” - PHP | "The requested PHP extension bcmath is missing from your system." Composer Install:系统中缺少所请求的PHP扩展zip - Composer Install : the requested PHP extension zip is missing from your system 您的系统中缺少请求的 PHP 扩展 mbstring - the requested PHP extension mbstring is missing from your system 您的系统中缺少请求的 PHP 扩展 dom - The requested PHP extension dom is missing from your system 您的系统中缺少请求的 PHP 扩展 json 和 mbstring - The requested PHP extension json and mbstring is missing from your system symfony2 SonataAdminBundle intl-ext错误 - symfony2 SonataAdminBundle intl-ext error GitLab PHP docker 映像 - 从您的扩展系统 gd7 中缺少请求的 Z2FEC392304A5C23AC138DA22847F9B7 - GitLab PHP docker image - the requested PHP extension gd is missing from your system 您的系统中缺少请求的 PHP 扩展 ext-mysql *。 在 PHP 7.1.7 中 - The requested PHP extension ext-mysql * is missing from your system. in php 7.1.7 ext-imagick * -> 系统中缺少请求的 PHP 扩展 imagick - ext-imagick * -> the requested PHP extension imagick is missing from your system 在 Yii2 中更新 Composer 时,系统中缺少请求的 PHP 扩展 ext-soap * - The requested PHP extension ext-soap * is missing from your system when updating composer in Yii2
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM