Composer installing: the json extension is missing(Composer 安装:缺少 json 扩展)
问题描述
我在 Linux 终端中写道:curl -s https://getcomposer.org/installer |php它说:
I wrote in Linux Terminal:
curl -s https://getcomposer.org/installer | php
It said:
#!/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 的列表:
I did this: apt-get install php5-json
So, I think, it's installed. But the strange thing is, when I write php -m
It gives me a list without 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 上都没有找到解决方案
What am I doing wrong? I haven't found the solution at GitHub and Google
推荐答案
我遇到了同样的错误,但不同的是,当我运行 php -m 时 json模块未列出,所以我只是使用以下命令安装了 json PHP 模块:
I encountered the same error, but the difference was that when I ran php -m the json module was not listed, so I just installed json PHP module using the command below:
sudo yum install php-json
错误已修复,我可以安装 composer.我使用的是 CentOS 8 流,PHP7.2.
the error was fixed and I was able to install composer. I was using CentOS 8 stream, PHP7.2.
这篇关于Composer 安装:缺少 json 扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Composer 安装:缺少 json 扩展
基础教程推荐
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- 如何替换eregi() 2022-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
