我遇到了这样的情况,当我在我的PHP项目上运行
我正在使用PHP 5.6。
请问我该如何在Ubuntu上安装Phar?
[编辑] 当我尝试
然后,如果我尝试执行
composer install
时,会出现以下错误:
Fatal error: Class 'Phar' not found in /usr/local/bin/composer on line 23
根据我在composer update class phar not found中的阅读,我尝试通过执行php -i | grep 'phar'
来检查是否安装了Phar,但是Phar没有安装。我正在使用PHP 5.6。
请问我该如何在Ubuntu上安装Phar?
[编辑] 当我尝试
apt-get install php-phar
时,会出现以下错误:Package php-phar is a virtual package provided by:
php7.2-common 7.2.7-1+ubuntu14.04.1+deb.sury.org+1
php7.1-common 7.1.19-1+ubuntu14.04.1+deb.sury.org+1
php5.6-common 5.6.36-1+ubuntu14.04.1+deb.sury.org+1
php7.0-common 7.0.30-1+ubuntu14.04.1+deb.sury.org+1
You should explicitly select one to install.
然后,如果我尝试执行
apt-get install php5.6-common
:php5.6-common is already the newest version.
php5.6-common set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 295 not upgraded.
php -i|grep phar
没有显示任何内容。如果我运行locate phar.so
,则没有结果。我已经尝试在 php.ini 中包含extension = phar.so
,但它并没有解决问题。 - Arnaud