鍍金池/ 問答/PHP  HTML/ 為什么安裝composer總是失敗,提示缺少phar?

為什么安裝composer總是失敗,提示缺少phar?

參數(shù):

Configure Command =>  './configure'  '--prefix=/usr/local/php7' '--with-config-file-path=/usr/local/php7/etc' '--enable-fpm' '--with-fpm-user=www' '--with-fpm-group=www' '--with-mysqli' '--with-pdo-mysql' '--with-iconv-dir' '--with-freetype-dir' '--with-jpeg-dir' '--with-png-dir' '--with-zlib' '--with-libxml-dir=/usr' '--enable-xml' '--disable-rpath' '--enable-bcmath' '--enable-shmop' '--enable-sysvsem' '--enable-inline-optimization' '--with-curl' '--enable-mbregex' '--enable-mbstring' '--with-mcrypt' '--enable-ftp' '--with-gd' '--enable-gd-native-ttf' '--with-openssl' '--with-mhash' '--enable-pcntl' '--enable-sockets' '--with-xmlrpc' '--enable-zip' '--enable-soap' '--without-pear' '--disable-phar' '--with-gettext' '--disable-fileinfo' '--enable-maintainer-zts'
[root@bogon php-7.1.11]# curl -sS https://getcomposer.org/installer | 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 phar extension is missing.
Install it or recompile php without --disable-phar

明明已經(jīng)添加過了 --disable-phar 參數(shù)了,用 php -m 查看沒有這個(gè)模塊的?如何解決?

回答
編輯回答
落殤

當(dāng)年,我還用PHP5的時(shí)候碰到過個(gè)問題
sudo apt-get install php5-json
安裝了這個(gè)包以后,莫名就好了,你是PHP7 試試 php7-josn,不知道包名是不是這樣寫

2017年12月6日 16:19
編輯回答
黑與白

直接在編輯的時(shí)候,刪除了 --disable-phar 解決了

2018年4月27日 02:51