Can't enable HTTPS and SSL streams in PHP no matter what

5,061

The HTTP stream includes HTTPS as of PHP 4.3.0, it's not a separate stream in phpinfo(). http://www.php.net/manual/en/wrappers.http.php

Share:
5,061

Related videos on Youtube

Issao
Author by

Issao

Updated on September 18, 2022

Comments

  • Issao
    Issao over 1 year

    I've been trying to enable my HTTPS/SSL (443) streams in PHP but no had success at all. My certs are properly installed and I can normally browse through the site using HTTPS, but phpinfo() tells that such streams are not installed, at least for PHP.

    This is the actual error I'm having with php:

    ssl://gateway.sandbox.push.apple.com:2195... Thu, 14 Mar 2013 19:44:40 +0100 ApnsPHP3893: ERROR: Unable to connect to 'ssl://gateway.sandbox.push.apple.com:2195': Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?

    I'm using:

    • 64bit SUSE Linux AMI from Amazon
    • Apache 2.2.12
    • PHP 5.2.14
    • MySQL working fine

    Phpinfo() tells me:

    additional .ini files parsed: /etc/php5/conf.d/ctype.ini, /etc/php5/conf.d/curl.ini, /etc/php5/conf.d/dom.ini, /etc/php5/conf.d/gd.ini, /etc/php5/conf.d/hash.ini, /etc/php5/conf.d/iconv.ini, /etc/php5/conf.d/json.ini, /etc/php5/conf.d/mbstring.ini, /etc/php5/conf.d/mysql.ini, /etc/php5/conf.d/mysqli.ini, /etc/php5/conf.d/openssl.ini, /etc/php5/conf.d/pcntl.ini, /etc/php5/conf.d/pdo.ini, /etc/php5/conf.d/pdo_mysql.ini, /etc/php5/conf.d/pdo_sqlite.ini, /etc/php5/conf.d/soap.ini, /etc/php5/conf.d/sqlite.ini, /etc/php5/conf.d/suhosin.ini, /etc/php5/conf.d/tokenizer.ini, /etc/php5/conf.d/xmlreader.ini, /etc/php5/conf.d/xmlwriter.ini, /etc/php5/conf.d/zip.ini
    
    Registered PHP Streams: php, file, data, http, ftp
    Registered Stream Socket Transports: tcp, udp, unix, udg
    
    cURL support enabled
    cURL Information libcurl/7.19.0 OpenSSL/0.9.8j zlib/1.2.3 libidn/1.10
    

    Mod_ssl also shows under the loaded modules section and extension=openssl.so is properly set in php.ini as well.

    Someone has told me to try php -i | grep 'Configure Command', which resulted in the following error:

    php: error while loading shared libraries: libmm.so.14: cannot open shared object file: No such file or directory

  • Issao
    Issao about 11 years
    Thanks. Why those streams don't show at my phpinfo() output and in fact they're not working. I can't connect SSL to other sites, it says the stream type is not available... Comparing to other servers, I understand that https, ssl and ftps should be at the Registered PHP Streams.
  • ceejayoz
    ceejayoz about 11 years
    Are you trying to use ssl:// URLs? Use https://.
  • ceejayoz
    ceejayoz about 11 years
    The HTTPS stream is listed as "http", which covers HTTP and HTTPS. The FTPS stream is listed as "ftp", which covers FTP and FTPS. The doc I linked makes this pretty clear...
  • ceejayoz
    ceejayoz about 11 years
    Browsing your own site has nothing to do with the available streams, that's handled by your webserver, not PHP.
  • Issao
    Issao about 11 years
    I got it. Basically you're saying that probably the streams are available, but they just dont show explicitly. So why I get the error when I try to connect to another address using ssl and when I remove the SSH, it works fine? Example: ssl://gateway.sandbox.push.apple.com:2195 Thu, 14 Mar 2013 19:44:40 +0100 ApnsPHP3893: ERROR: Unable to connect to 'ssl://gateway.sandbox.push.apple.com:2195': Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
  • ceejayoz
    ceejayoz about 11 years
    SSH requires a PECL extension and is used via ssh2://. php.net/manual/en/wrappers.ssh2.php ssl:// doesn't appear to exist. php.net/manual/en/wrappers.php Read the pages on supported protocols and wrappers I'm linking repeatedly to, please. You may want to use fsockopen.
  • Issao
    Issao about 11 years
    Thank you. I'm considering re-compile PHP, so the ssl and https protocols/streams are supported by it. I figure out that when these protocols/streams are not shown with phpinfo() it means they're really not available, differently than: "HTTPS stream is listed as "http", which covers HTTP and HTTPS. The FTPS stream is listed as "ftp", which covers FTP and FTPS"