Welcome Guest. Please Login or Register  


You are here: Index > Webuzo > General Support > Topic : Problem with SSL and PHP 5.6



Threaded Mode | Print  

 Problem with SSL and PHP 5.6 (7 Replies, Read 28693 times)
stonecold111
Group: Member
Post Group: Newbie
Posts: 11
Status:
Hi,
I ran into a problem of getting "/usr/local/apps/php56/bin/pecl" to download any scripts from pecl.net. It always returns "No releases available for package "pecl.php.net/igbinary"
install failed

When I run this command
Code

[root@kl bin]# /usr/local/apps/php56/bin/pecl list-all


it returns

Code

Connection to `ssl://pecl.php.net:443' failed: Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?


I read a few threads about enabling/uncommenting php_openssl.so in php.ini but I don't see it included in the extension or in php.ini. I see that there is an extension called openssl.so but is it the same as php_openssl.so?



IP: --   

Problem with SSL and PHP 5.6
stonecold111
Group: Member
Post Group: Newbie
Posts: 11
Status:
Code
[root@kl bin]# openssl version
OpenSSL 1.0.1e-fips 11 Feb 2013

Just checked my openssl version.
IP: --   

Problem with SSL and PHP 5.6
stonecold111
Group: Member
Post Group: Newbie
Posts: 11
Status:
What phpinfo() shows:

Code

OpenSSL support    enabled
OpenSSL Library Version    OpenSSL 1.0.1h 5 Jun 2014
OpenSSL Header Version    OpenSSL 1.0.1k 8 Jan 2015

Directive              Local Value    Master Value
openssl.cafile      no value            no value
openssl.capath  no value            no value
IP: --   

Problem with SSL and PHP 5.6
stonecold111
Group: Member
Post Group: Newbie
Posts: 11
Status:
It turns out there are a few changes regarding SSL in PHP 5.6 that some modifications are needed in my case.

1. Run the following command in putty:
Code
php -r "print_r(openssl_get_cert_locations());"


2. It returns an array like this:

Array
(
    [default_cert_file] => /usr/local/apps/etc/openssl/cert.pem
    [default_cert_file_env] => SSL_CERT_FILE
    [default_cert_dir] => /usr/local/apps/etc/openssl/certs
    [default_cert_dir_env] => SSL_CERT_DIR
    [default_private_dir] => /usr/local/apps/etc/openssl/private
    [default_default_cert_area] => /usr/local/apps/etc/openssl
    [ini_cafile] =>
    [ini_capath] =>
)

3. Note that  /usr/local/apps/etc/openssl/cert.pem isn't present. Download a cUrl cert bundle , as suggested by this thread from Stackoverflow

4. save the bundle in  '/usr/local/apps/etc/openssl/'  and rename it as 'cert.pem'

Everything has been fixed. I thought it would be troublesome but turned out it was easy as pie~
IP: --   

Problem with SSL and PHP 5.6
divij
Group: Member
Post Group: Elite Member
Posts: 290
Status:
Hi,

Glad to know your issue is resolve.

Thanks for sharing the solution also.
IP: --   

Problem with SSL and PHP 5.6
peopleinside
Group: Member
Post Group: Super Member
Posts: 1257
Status:
Hi,
great discussion.

I can say:



Run:

php -r "print_r(openssl_get_cert_locations());"

on SSH give me an error:

PHP Fatal Error Call to undefined function openssl_get_cert_locations() in Command line code on line 1



so I tried to download the .pem file at this address: https://curl.haxx.se/docs/caextract.html as suggested by the forum topic than uploaded in /usr/local/apps/etc/openssl/ and renamed cert.pem



Now switched to PHP 5.6 and logged in Hesk, gone on settings, email and
test SMTP and POP 3 now the POP settings don't print any error, is
passed but SMTP continue to give error.



Tried to remove the cert.pem uploaded by me and with PHP 5.6 the POP 3 test in Hesk fails too.

So in the Forum topic the uploading of the cert.pem file resolve the pop issue but not SMTP.


I AM using for my email a personal Webiste SSL Comodo certificate. So don't know if the issue is maybe in the cabounde who should be downloaded somewhere else or why POP3 Fetching now works in Hesk but not SMTP.


-----------------------
PeopleInside  :angel:
Passionate Webuzo User
IP: --   

Problem with SSL and PHP 5.6
peopleinside
Group: Member
Post Group: Super Member
Posts: 1257
Status:
Ok I found the solution and for me is quite different to all discussion posted here.

The solution is not download Ca Boundle and upload into openssl folder but as I Am using already an SSL certificate just add this line in the PHP 5.6 php.ini

[openssl]

openssl.cafile= /path/to/your/.ca-bundle

where "/path/to/your/.ca-bundle" is your patch to your ca-bundle file.
All is working now with PHP 5.6


-----------------------
PeopleInside  :angel:
Passionate Webuzo User
IP: --   

Problem with SSL and PHP 5.6
peopleinside
Group: Member
Post Group: Super Member
Posts: 1257
Status:
Thank you to SSLS.com Staff who helped me to solve PHP 5.6 / 7 and SSL Issue. I AM always an happy customer of them.


-----------------------
PeopleInside  :angel:
Passionate Webuzo User
IP: --   

« Previous    Next »

Threaded Mode | Print  



Jump To :


Users viewing this topic
1 guests, 0 users.


All times are GMT. The time now is December 10, 2018, 2:06 am.

  Powered By AEF 1.0.8 © 2007-2008 Electron Inc.Queries: 10  |  Page Created In:0.760