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.
这篇好文章是转载于:学新通技术网
- 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
- 本站站名: 学新通技术网
- 本文地址: /reply/detail/tangbhfhk
-
YouTube API 不能在 iOS (iPhone/iPad) 工作,但在桌面浏览器工作正常?
it1352 07-30 -
保持在后台运行的 iPhone 应用程序完全可操作
it1352 07-25 -
iPhone,一张图像叠加到另一张图像上以创建要保存的新图像?(水印)
it1352 07-17 -
使用 iPhone 进行移动设备管理
it1352 07-23 -
在android同时打开手电筒和前置摄像头
it1352 09-28 -
扫描 NFC 标签时是否可以启动应用程序?
it1352 08-02 -
检查邮件是否发送成功
it1352 07-25 -
Android微调工具-删除当前选择
it1352 06-20 -
希伯来语的空格句子标记化错误
it1352 06-22 -
Android App 和三星 Galaxy S4 不兼容
it1352 07-20