Composer:您的系统中缺少请求的 PHP 扩展 ext-intl * [英] Composer: The requested PHP extension ext-intl * is missing from your system

查看:122
本文介绍了Composer:您的系统中缺少请求的 PHP 扩展 ext-intl *的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 composer.json 文件.但是,当我尝试在 path/project/ 中运行命令 'composer install' 时,出现错误:

I am trying to use composer.json file. but, when I am trying to run command 'composer install' in my path/project/, I am getting an error:

我已经为 'extension=php_intl.dll' 配置了我的 wamp 并在 ' 中复制了所有 icu*.dllD:wampinapacheapache2.2.22in' 来自 'D:wampinphpphp5.3.13' 并且它显示在 phpinfo():

I have already configured my wamp for 'extension=php_intl.dll' and copied all icu*.dll in 'D:wampinapacheapache2.2.22in' from 'D:wampinphpphp5.3.13' and it's showing in phpinfo():

无需复制 icu*.dll 也可以工作并显示在 phpinfo();

without copy icu*.dll also works and showing in phpinfo();

如果我的 wampintl,请告诉我>composer install 在我的电脑上,那么为什么我会收到此错误.真的,太烦人了.

Kindly, let me know if I have intl install on my wamp and composer install on my pc then why I am getting this error. really, it is so annoying.

这是我的详细信息:

  1. 操作系统:Windows 7 (64)
  2. PHP:5.3.13
  3. Apache:2.2.22
  4. Composer:由可执行文件安装
  5. Pear:已安装(最新)
  6. PHPUnit:已安装(最新)

我的composer.json如下:

My composer.json is as below:

{
    "name" : "sebastian/money",
    "description" : "Value Object that represents a monetary value (using a currency's smallest unit)",
    "keywords" : ["money"],
    "homepage" : "http://www.github.com/sebastianbergmann/money",
    "license" : "BSD-3-Clause",
    "authors" : [{
            "name" : "Sebastian Bergmann",
            "email" : "sebastian@phpunit.de"
        }
    ],
    "require" : {
        "php" : ">=5.3.3",
        "ext-intl" : "*"
    },
    "require-dev" : {
        "phpunit/phpunit" : "~4.0"
    },
    "autoload" : {
        "classmap" : [
            "src/"
        ]
    },
    "extra" : {
        "branch-alias" : {
            "dev-master" : "1.3.x-dev"
        }
    }
}

如果需要任何其他详细信息,请告诉我..

Let me know if any other details is required..

任何反馈/帮助将不胜感激.

Any feedback/help would be highly appreciated.

推荐答案

PHP 对命令行 php 与 web/apache php 使用不同的 php.ini.所以你在浏览器的 phpinfo() 中看到了 intl 扩展,但是如果你在命令行中运行 php -m 你可能会看到那里的扩展列表不包括 intl.

PHP uses a different php.ini for command line php than for the web/apache php. So you see the intl extension in phpinfo() in the browser, but if you run php -m in the command line you might see that the list of extensions there does not include intl.

您可以在输出顶部使用 php -i 检查它应该告诉您从哪里加载 ini 文件.确保您在该 ini 文件中启用了 intl 扩展,您应该一切顺利.

You can check using php -i on top of the output it should tell you where the ini file is loaded from. Make sure you enable the intl extension in that ini file and you should be good to go.

对于php.ini 5.6版本(使用php -v检查版本)

For php.ini 5.6 version (check version using php -v)

;extension=php_intl.dll 
; remove semicolon
extension=php_intl.dll

对于 php.ini 7.* 版本

For php.ini 7.* version

;extension=intl
; remove semicolon
extension=intl

这篇关于Composer:您的系统中缺少请求的 PHP 扩展 ext-intl *的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆