Lajos Arpad
Lajos Arpad

Reputation: 76426

Why is my PHP extension used by Symfony invalid after ubuntu update?

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?

Upvotes: 8

Views: 6389

Answers (1)

luchaninov
luchaninov

Reputation: 6786

Use

"ext-json": "*",

If it's not your library and you cannot change the code, use

composer install -n --ignore-platform-reqs

Upvotes: 18

Related Questions