I am working on a Symfony project. Yesterday an Ubuntu update (automatic) was executed and now, if I run
sudo composer install
then I get this error:
The requested PHP extension ext-json ^1.6 has the wrong version (7.4.1) installed. Install or enable PHP's json extension.
I have checked the extensions, like:
apt-cache search php | grep json
php7.2-json - JSON module for PHP
jsonlint - validating parser of JSON data structures
php-json-schema - implementation of JSON schema
php-services-json - PHP implementaion of json_encode/decode
php-json - JSON module for PHP [default]
php5.6-json - JSON module for PHP
php7.0-json - JSON module for PHP
php7.1-json - JSON module for PHP
php7.3-json - JSON module for PHP
php7.4-json - JSON module for PHP
and in composer.json I can see this line:
"ext-json": "^1.6",
How can I ensure that my extension is installed and enabled in the version composer expects it to be?
php file extension refers to the name of a file with a PHP script or source code that has a ". PHP" extension at the end of it. It's similar to a Word file with a . doc file extension.
The HTTP Extension Framework describes a generic extension mechanism for HTTP, which is designed to address the tension between private agreement and public specification and to accommodate extension of applications using HTTP clients, servers, and proxies.
Use
"ext-json": "*",
If it's not your library and you cannot change the code, use
composer install -n --ignore-platform-reqs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With