作曲家安装:json扩展名丢失 [英] Composer installing: the json extension is missing
问题描述
我在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
c $ c> 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
时发送:
And when I write php5-fpm -m
It sends this:
[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.ini
文件。要找出命令行PHP的位置,请执行
You probably need to enable the extension in your php.ini
file. To find out where that is for command line PHP, do
php --ini
您应该看到一行
加载的配置文件:/path/to/php.ini
Loaded Configuration File: /path/to/php.ini
打开该文件并查找 extension = json.so
。如果它在那里,取消注释。如果没有,添加它。现在你应该看到 json
列出当你 php -m
和作曲家应该工作。
Open that file and look for extension=json.so
. If it's there, uncomment it. If not, add it in. Now you should see json
listed when you do php -m
and composer should work.
这篇关于作曲家安装:json扩展名丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!