Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Composer: The requested PHP extension ext-intl * is missing from your system

Tags:

composer-php

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:

enter image description here

I have already configured my wamp for 'extension=php_intl.dll' and copied all icu*.dll in 'D:\wamp\bin\apache\apache2.2.22\bin' from 'D:\wamp\bin\php\php5.3.13' and it's showing in phpinfo():

enter image description here

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

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.

Here is my details:

  1. OS: windows 7 (64)
  2. PHP: 5.3.13
  3. Apache:2.2.22
  4. Composer: installed by executable file
  5. Pear: installed (latest)
  6. PHPUnit: installed (latest)

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" : "[email protected]"
        }
    ],
    "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.

like image 719
Nono Avatar asked Mar 11 '14 17:03

Nono


People also ask

Can composer install PHP extensions?

Composer has platform packages, which are virtual packages for things that are installed on the system but are not actually installable by Composer. This includes PHP itself, PHP extensions and some system libraries.


3 Answers

I encountered this using it in Mac, resolved it by using --ignore-platform-reqs option.

composer install --ignore-platform-reqs

After installing with this method, if the package that defines the requirement attempts to use any functions from the specified PHP extension, it will fail irrevocably.

like image 69
Sky Avatar answered Oct 31 '22 18:10

Sky


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.

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.

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

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

For php.ini 7.* version

;extension=intl
; remove semicolon
extension=intl
like image 31
Seldaek Avatar answered Oct 31 '22 19:10

Seldaek


In linux (Debian Jessie for example):

apt-get install php7.0-intl

will make the job to you due will create a simbolic link to it.

like image 21
Anibal Developer Avatar answered Oct 31 '22 19:10

Anibal Developer