Composer update: The requested PHP extension ext-http missing
For those who encountered with this problem:
- The requested PHP extension ext-http * is missing from your system.
The solution is just to install PHP extension:
sudo apt install php-pecl-http
php-http
is a standard which is implemented by different packages. ext-http
is the Composer way to tell that your application requires at least one of those packages. See the section called "Composer virtual packages" at http://docs.php-http.org/en/latest/clients.html for additional details.
Differently than other packages, the ext-...
lines do not actually install anything via composer, they just make composer check that you have some required dependency.
Usually you can just install the corresponding PHP library, e.g. ext-zip
means that you need to install php-zip
. In this case, there is no single PHP library but a series of compatible libraries.
You should be able to fix your issue by installing one of the provided packages, e.g.
composer require php-http/curl-client
in my case i'm using ubuntu, hope this solve the problem.
sudo apt install php-http
Update: It might be worth looking at the other answers too. Since I'm no longer working with PHP, I'm not going to set up a project and try to recreate the problem I had just to test the new suggested solutions. If another answer did help you, give it a vote '^' this way I know which answers are helpful.
The solution is found. For some reason my composer.json
contained "ext-http": "*"
.
"require": {
"ext-http": "*"
}
Removing this line fixed the problem. I don't know why it contained "ext-http": "*"
and I don't fully understand why removing it would fix the problem. (Is it because it is looking for the extension, but can not find it?)
(Thank you to everyone trying to help me fix the problem!)