gpt4 book ai didi

php - Composer 安装 : the json extension is missing

转载 作者:可可西里 更新时间:2023-11-01 00:43:23 24 4
gpt4 key购买 nike

我在 Linux 终端中写道:curl -s https://getcomposer.org/installer | php它说:

 #!/usr/bin/env php
Some settings on your machine make Composer unable to work properly.
Make sure that you fix the issues listed below and run this script again:

The json extension is missing.
Install it or recompile php without --disable-json

我这样做了:apt-get install php5-json所以,我想,它已经安装好了。但奇怪的是,当我写 php -m它给了我一个没有 json 的列表:

[PHP Modules]
bcmath
bz2
calendar
Core
ctype
date
dba
dom
ereg
exif
fileinfo
filter
ftp
gettext
hash
iconv
libxml
mbstring
mhash
openssl
pcntl
pcre
Phar
posix
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlwriter
zip
zlib

[Zend Modules]

当我写 php5-fpm -m它发送这个:

[PHP Modules]
bcmath
bz2
calendar
cgi-fcgi
Core
ctype
curl
date
dba
dom
ereg
exif
fileinfo
filter
ftp
gettext
hash
iconv
json
libxml
mbstring
mcrypt
mhash
mysqli
openssl
pcre
PDO
pdo_mysql
Phar
posix
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlwriter
zip
zlib

[Zend Modules]

我做错了什么?我在 GitHub 和 Google 上都没有找到解决方案

最佳答案

我遇到了同样的错误,但不同的是,当我运行 php -m 时,没有列出 json 模块,所以我只是使用命令如下:

sudo yum install php-json

错误已修复,我可以安装 composer。我使用的是 CentOS 8 stream,PHP7.2。

关于php - Composer 安装 : the json extension is missing,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27437206/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com