为什么我的 Symfony 使用的 PHP 扩展在 ubuntu 更新后无效? [英] Why is my PHP extension used by Symfony invalid after ubuntu update?
问题描述
我正在做一个 Symfony 项目.昨天执行了 Ubuntu 更新(自动),现在,如果我运行
I am working on a Symfony project. Yesterday an Ubuntu update (automatic) was executed and now, if I run
sudo composer install
然后我收到此错误:
请求的 PHP 扩展 ext-json ^1.6 版本错误(7.4.1) 安装.安装或启用 PHP 的 json 扩展.
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
在 composer.json 中我可以看到这一行:
and in composer.json I can see this line:
"ext-json": "^1.6",
如何确保我的扩展程序已安装并在 Composer 预期的版本中启用?
How can I ensure that my extension is installed and enabled in the version composer expects it to be?
推荐答案
使用
"ext-json": "*",
如果它不是您的库并且您无法更改代码,请使用
If it's not your library and you cannot change the code, use
composer install -n --ignore-platform-reqs
这篇关于为什么我的 Symfony 使用的 PHP 扩展在 ubuntu 更新后无效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!