Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 654
Lajos Arpad Avatar asked Dec 20 '19 09:12

Lajos Arpad


People also ask

What are PHP extensions?

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.

What is Ext HTTP?

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.


1 Answers

Use

"ext-json": "*",

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

composer install -n --ignore-platform-reqs
like image 85
luchaninov Avatar answered Oct 10 '22 17:10

luchaninov