How to enable OpenSSL for PHP Cli?
22,285
Same trouble for me. After spending some hours searching for a solution I find out that the command php
is associated with an old version of php as against of the php5
command on my development mashine:
php -v
PHP 5.3.18 (cli) (built: Nov 20 2012 19:34:35)
php5 -v
PHP 5.5.3-1ubuntu2.1 (cli) (built: Dec 12 2013 04:24:35)
So I reinstalled composer with the following command and now it works for me:
curl -sS https://getcomposer.org/installer | php5
Best regards!
Related videos on Youtube
Author by
Vivek
Updated on September 18, 2022Comments
-
Vivek over 1 year
There is no major difference in the
php.ini
files located at/etc/php5/apache2/php.ini
and/etc/php5/cli/php.ini
. But<?php phpinfo(); ?>
when accessed from a browser says OpenSSL support enabled whereasphp -info | grep openssl
executed in a terminal givesOpenSSL support => disabled (install ext/openssl)
.I have the latest versions of
libssl-dev
andopenssl
installed. How to enable OpenSSL for cli version?-
Alvar over 10 yearsIs there a GUI version of PHP?
-
-
Vivek over 10 years
sudo curl -sS https://getcomposer.org/installer | sudo php5
did not work for me. I had to recompile php from source with openssl to make composer work. -
ckujau about 7 yearsThere's no need to run
curl
via sudo. And running random scripts from the internet is also considered dangerous and should not be recommended lightly.