We help IT Professionals succeed at work.
Get Started

Openssl enabled via web but disabled when using php cli

FFT asked
Last Modified: 2015-05-10

I'm using php 5.4.38 wich was compiled with open ssl (-with-openssl)

Via the web phpinfo() reads :

OpenSSL support 	enabled
OpenSSL Library Version 	OpenSSL 0.9.8o 01 Jun 2010
OpenSSL Header Version 	OpenSSL 0.9.8o 01 Jun 2010 

Open in new window

Using openssl with php cli does not work

php -i | grep ssl
OpenSSL support => disabled (install ext/openssl)

Even if I force php cli to use the web php.ini, I know that when using cli php uses a different php.ini

php -c /usr/local/php54/lib/php.ini -i | grep ssl
OpenSSL support => disabled (install ext/openssl)

I'm stuck there and when i want to download composer for php, the error message reads :
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 openssl extension is missing, which means that secure HTTPS transfers are impossible.
If possible you should enable it or recompile php with --with-openssl

Open in new window

Just for the record, here's a copy of my config for compiling php
'./configure' \
'--with-mysql=mysqlnd' \
'--with-mysqli=mysqlnd' \
'--prefix=/usr/local/php54' \
'--with-apxs2=/usr/local/apache2/bin/apxs' \
'--with-gd' \
'--enable-gd-native-ttf' \
'--with-png-dir=/lib' \
'--with-jpeg-dir=/usr/lib' \
'--with-zlib' \
'--enable-ftp' \
'--with-pdo-mysql=mysqlnd' \
'--with-mcrypt' \
'--with-freetype-dir=/usr/lib' \
'--enable-mbstring=all' \
'--with-openssl=/usr' \
'--with-curl=/usr/local/lib' \
'--enable-sockets' \
'--with-gettext=/usr/bin' \
'--enable-soap' \
'--enable-zip' \
'--with-imap=/usr/local/imap-2007f' \
'--with-libdir=lib64' \
'--with-kerberos=/usr' \

Open in new window

Watch Question
This problem has been solved!
Unlock 1 Answer and 7 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE