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 do I install the phar extension? I am running PHP 5.4.22 on my VPS.
You can modify your php.ini file to get this working. (Some hosts use a phprc file to enable different settings in PHP instead of php.ini. @jerrygarciuh On dreamhost, follow the directions here)
After you have added your php.ini/phprc file, add these lines to the file (just the first line if your server doesn't use Suhosin for security):
extension = phar.so
suhosin.executor.include.whitelist = phar
restart php if you need to (insert php version number with no decimals if different):
killall -9 php70.cgi
then check to make sure it is working:
php -m | grep Phar
Finish with the install of composer and you should be good to go.
Mind to install phar extension for php.
urpmi php-phar
or
apt-get install php-phar
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With