Composer: The requested PHP extension ext-intl * is missing from your system - 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:
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():
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:
OS: windows 7 (64)
PHP: 5.3.13
Apache:2.2.22
Composer: installed by executable file
Pear: installed (latest)
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" : "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.

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.

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

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.

To enable intl extension follow the instructions below.
You need enable extension by uncommenting the following line extension=php_intl.dll in the C:\xampp\php\php.ini file.
Once you uncomment the extension=php_intl.dll, then you must restart apache server using XAMPP control panel.
//about line 998
;extension=php_intl.dll
change as
extension=php_intl.dll
(Note: php.ini file mostly in the following directory C:\xampp\php)
Restart xampp

just remove them
"ext-intl" : "*"
from your composer.json file.
Because sometimes for some helper functions, the IDE complains that the extension is missing from the composer.json file. Immediately press Alt+Enter to add it to the composer. But that doesn't mean that composer will count them in. The composer will complain next time while doing some operations. So that, we should not blindly type Alt+Enter rather than installing them manually in composer by doing composer install <package-name>.
As I think you have entered it manually, you should remove it, then install it in proper procedure composer install <package-name>
Or else you can run composer update to count that added dependencies in.

If You have got this error while running composer install command,
don't worry.
Steps to be followed and requirements:
Step1: Go to server folder such as xampp(or) wampp etc.
Step2: open php folder inside that and go to ext folder.
Step3: If you find a file named as php_intl.dll no problem.
Just go to php.ini file and uncomment the line
From:
;extension=php_intl.dll
To:
extension=php_intl.dll
Step4: restart xampp, thats it
Note: If you don't find any of the file named as
php_intl.dll, then you need to upgrade the PHP version.

(with xampp server)open php.ini in ".\xampp\php"
change ;extension=intl to extension=intl

This is bit old question but I had faced same problem on linux base server while installing magento 2.
When I am firing composer update or composer install command from my magento root dir. Its was firing below error.
Problem 1
- The requested PHP extension ext-intl * is missing from your system. Install or enable PHP's intl extension.
Problem 2
- The requested PHP extension ext-mbstring * is missing from your system. Install or enable PHP's mbstring extension.
Problem 3
- Installation request for pelago/emogrifier 0.1.1 -> satisfiable by pelago/emogrifier[v0.1.1].
- pelago/emogrifier v0.1.1 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
...
Then, I searched for the available intl & intl extensions, using below commands.
yum list php*intl
yum install php-intl.x86_64
yum list php*mbstring
yum install php-mbstring.x86_64
And it fixed the issue.

In latest XAMPP version;
You need to find only intl(Line no 912)in php.ini file.
Change
;extension=intl
To
extension=intl

I have faced the same issue on my server. And it is mainly happened due to miss-match of php version between server version and your system version. I am using Nginx and checked on all my project configuration files, it uses php8.0 but on my terminal it shows php.8.1. Actually my application needs php8.0. The following steps resolved my issue.
To see all my running php versions
sudo update-alternatives --config php
It shows the following page
Selecting php8.0 for my application. Run the command to see Nginx scripts are ok
sudo nginx -t
Then reload the Nginx
sudo systemctl reload nginx
Finally go to your project directory and update or install your composer
composer update
It has been resolved my issue, I expect same will resolve yours.

In my case, I am using ubuntu, run this command, it will be solved if your system is also ubuntu.
sudo apt-get install php-intl

Related

Phalcon - Composer install of Dev-Tools error: requested PHP extension -

composer install with file compose.json
{
"require-dev": {
"phalcon/devtools": "~3.4"
}
}
should install Phalcon Dev-Tools.
Actual Behavior
Instead, it breaks with error
Your requirements could not be resolved to an installable set of packages.
Problem 1
Installation request for phalcon/devtools ~3.4 -> satisfiable by phalcon/devtools[v3.4.0].
phalcon/devtools v3.4.0 requires ext-phalcon ~3.3 -> the requested PHP extension phalcon is missing from your system.
To enable extensions, verify that they are enabled in your .ini files:
/Applications/MAMP/bin/php/php7.2.1/conf/php.ini You can also run php --ini inside a terminal to see which files are used by PHP in CLI mode.
Details
MacOS 10.13.5,
MAMP 4, PHP 7.2.1
php_phalcon.so 3.4 is copied into the extension directory and inserted into php.ini from php-phalcon-mamp
proof:
php -m
phalcon
....
how to force update composer ignoring the dependencies?
I figured it out by running the below command.
composer update --ignore-platform-reqs
composer install --ignore-platform-reqs

Cannot install laravel oci8

the composer require yajra/laravel-oci8:^8 command is giving me the following error:
C:\Users\yƶ\PhpstormProjects\BRP>composer require yajra/laravel-oci8:^8
./composer.json has been updated
Running composer update yajra/laravel-oci8
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires yajra/laravel-oci8 8 -> satisfiable by yajra/laravel-oci8[v8.0.0].
- yajra/laravel-oci8 v8.0.0 requires ext-oci8 >=2.0.0 -> it is missing from your system. Install or enable PHP's oci8 extension.
To enable extensions, verify that they are enabled in your .ini files:
- C:\PHP74\php.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
Windows 10
PHP 7.4.6
Laravel 8.26.1
PHP Storm 2020.2.3
I am not using XAMMP or WAMP
I hope someone can help me out. Thank you in advance.
You are missing the OCI8 PHP extension, So follow these steps:
From http://pecl.php.net/package/oci8 download exact version, for you must be php_oci8-2.2.0, unzip it and copy to PHP ext folder, for you its in "C:\php74\ext"
Un-Comment "extension=php_oci8_11g.dll" in php.ini and restart Apache or any other web server that you are using
Check php_info(), oci8 should be enabled.
Run composer require yajra/laravel-oci8:^8 command again.
download extensions with suitable php version in https://windows.php.net/downloads/pecl/releases/oci8/
extract and copy all the .dll files to /xampp/php/ext
download instant client oracle with suitable OS and PHP version in http://www.oracle.com/technetwork/topics/winsoft-085727.html
extract and copy all the dll files to /xampp/apache/bin/ and copy it to /xampp/php/
install https://github.com/yajra/laravel-oci8

enable dom file inside the php.ini

I'm facing some problems with the laravel in every time I create the new one or update the composer I get this error "phpunit/phpunit 7.5.1 requires ext-dom * -> the requested PHP extension dom is missing from your system". .I'm pretty sure that I've installed the dom file but the problem cant find it inside the php.ini althought I tried to do that by type "extension=dom.so "
Try running this command in your ubuntu server.
sudo apt-get update
sudo apt-get install php7.1-xml

How to install composer - Missing openssl

I have read How to enable PHP's openssl extension to install Composer? and You must enable the openssl extension to download files via https
They both state that the php file needs to uncomment extension=php_openssl.dll from the php.ini files which live in both these folders:
C:\wamp64\bin\apache\apache2.4.17
C:\wamp64\bin\php\php7.0.0
C:\wamp64\bin\php\php5.6.16 ' I don't think I need to, but did it any way
I've done that, and then restarted the PC.
WAMP is running on my Windows 10 machine
The same error always shows when trying to install Composer
Some settings on your machine make Composer unable to work properly.
Make sure that you fix the issues listed below and run this script again:
The openssl extension is missing, which means that secure HTTPS transfers are impossible.
If possible you should enable it or recompile php with --with-openssl
What do I need to do to install Composer?
Edit
From C:\PHP (the PHP folder) I started a command prompt and ran php -r "phpinfo();"
In the results, there is the following:
OpenSSL support => disabled (install ext/openssl)
I have followed http://php.net/manual/en/faq.installation.php#faq.installation.addtopath
You have multiple version of PHP installed:
C:\wamp64\bin\php\php7.0.0
C:\wamp64\bin\php\php5.6.16
C:\PHP
The PHP version, which you run on the CLI is based on your environment PATH variable. The first PHP path wins.
run php --ini on the CLI. It will show you which php.ini is included and also the path of PHP
edit this php.ini file and activate the extension=php_openssl.dll
then run php -m to check, if the extension is loaded
then run composer

Install Laravel framework on WAMP

I have been trying to install Laravel framework on WAMP.
I been following the steps from http://laravel.com/
and Installing Laravel 4.1 in Windows 7 // Make .phar file globally available to windows command line
When i run the command
composer create-project laravel/laravel --prefer-dist , getting the error message
[RuntimeException]
You must enable the openssl extension to download files via https
But i have enabled openssl in php.ini by removing the comment sign.
Please help
If you are using WAMPServer here is the problem:
WAMPServer's PHP CLI ( Command Line Interface ) i.e. running php.exe from command line uses a different php.ini to the one used by PHP in Apache.
Edit \wamp\bin\php\php5.x.y\php.ini
Activate the extensions you require the PHP CLI to have access to in the usual way i.e. remove the comment ';' from the extension=php_xxxx.dll line.
Wamp uses 2 php.ini
first one that you changed from the Wamp panel and second one that located on Apache folder.
i think on the wamp/bin/apache/bin make sure to enable openssl on both and restart the Wamp.
This worked for me. Hope this helps you.
Install Laravel Framework in Windows *PHP version greater than
5.3.7 is required.
Download Laravel from: https://github.com/laravel/laravel/archive/master.zip.
Extract Laravel into the www folder for WAMP.
Download Composer from: https://getcomposer.org/Composer-Setup.exe
Enable openssl from all php.ini files
Install Composer into the same directory php.exe is located.
Click on WAMP icon->PHP->PHP Extensions and enable: php_openssl, php_curl, php_socket.
Click on wamp icon->Apache->Apache Modules and enable ssl_module
Open cmd.
Change into the directory where you extracted Laravel e.g: cd C:\wamp\www\laravel.
Type the command: composer install.
Installation completed.
Open httpd.conf file
Add these lines after Include "c:/wamp/alias/"*
Listen 8000
DocumentRoot c:/wamp/www/laravel/public
Open Browser and go to localhost:8000
You follow given Only 1 step and install laravel 5 and composer in your machine
[1]Paste this in cmd : composer create-project laravel/laravel
when you run above command it will automatically install composer and laravel
OPTIONAL:
if error your configuration does not allow connection to
http//packages.firegento.com in cmd follow this command :
composer config -g secure-http false

Resources