How to install / enable PHP phar extension?

I am trying to install Composer on my KnownHost VPS. When I run this command:

curl -sS https://getcomposer.org/installer | php

I get this error message:

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

How to install phar extension? I am running PHP 5.4.22 on my VPS.

+4
source share
3 answers

I finally resolved this by getting my PHP recovery host with PDO support.

0
source

You can modify the php.ini file to make it work. (Some hosts use the phprc file to include various settings in PHP instead of php.ini. @Jerrygarciuh On dreamhost, follow the directions here )

, php.ini/phprc, ( , Suhosin ):

extension = phar.so 
suhosin.executor.include.whitelist = phar

php, ( php , ):

killall -9 php70.cgi

, :

php -m | grep Phar

, .

+4

phar- php.

urpmi php-phar

apt-get install php-phar
0

Source: https://habr.com/ru/post/1529019/


All Articles