SSL not work in PHP5.6 on Windows <p>I tried:</p> <pre><code>$host = 'ssl://fbcdn-sphotos-c-a.akamaihd.net'; $port = 443; $fp = fsockopen($host, $port, $errno, $errstr, 30); if (!$fp) { var_dump($errno, $errstr); } else { echo 'Connected'; } </code></pre> <p>And:</p> <pre><code>$host = 'ssl://fbcdn-sphotos-c-a.akamaihd.net:443'; $fp = stream_socket_client($host, $errno, $errstr, 30); if (!$fp) { var_dump($errno, $errstr); } else { echo 'Connected'; } </code></pre> <p>But both returns:</p> <pre><code>int(0) string(0) "" </code></pre> <p>As if I had not been able to connect.</p> <ul> <li>I tried PHP5.6 for x86 and PHP5.6 for x64</li> <li>I used lastet release in <a href="http://windows.php.net/download#php-5.6" rel="nofollow">http://windows.php.net/download#php-5.6</a></li> <li>In Linux it seems to work normally.</li> <li>This only occurs with some fields, others work well.</li> <li>PHP with CURL and SSL work fine in PHP5.6</li> </ul> <p><strong>Note:</strong> Strangely in php5.4 works perfectly.</p> <p>Is a bug in this version of PHP?</p> <h2>Details:</h2> <p>PHP 5.4.12</p> <blockquote> <p>Registered Stream Socket Transports: tcp, udp, ssl, sslv3, sslv2, tls</p> <p>Compiler: MSVC9 (Visual C++ 2008)</p> <p>Architecture: x64</p> <p>Configure Command (compile):</p> <pre><code>cscript /nologo configure.js "--enable-embed" "--enable-cli-win32" "--enable-apache2-2handler" "--enable-apache2-2filter" "--enable-apache2-4handler" "--with-mysql=shared" "--with-mysqli=shared" "--enable-pdo" "--with-pdo-mysql=shared" "--with-pgsql=shared" "--with-pdo-pgsql=shared" "--with-mcrypt=static" "--with-openssl=shared" "--enable-sockets=shared" "--enable-intl=shared" "--enable-mbstring=shared" "--enable-mbregex" "--enable-exif=shared" "--with-xmlrpc=shared" "--with-xsl=shared" "--enable-solr=shared" "--enable-solr-debug" "--with-curl=shared" "--with-tidy=shared" "--with-bz2=shared" "--enable-rar=shared" "--enable-fileinfo=shared" "--with-gettext=shared" "--with-mhash" "--with-ldap=shared" "--enable-com-dotnet=shared" "--enable-soap=shared" "--enable-shmop=shared" "--with-gmp=shared" "--with-interbase=shared" "--with-pdo-firebird=shared" "--with-sqlite3=shared" "--with-pdo-sqlite=shared" "--with-pdo-odbc=shared" "--enable-dbase=shared" "--with-pdo-oci=C:\php-sdk\oracle\x64\instantclient_10_2\sdk,shared" "--with-oci8=C:\php-sdk\oracle\x64\instantclient_10_2\sdk,shared" "--with-oci8-11g=C:\php-sdk\oracle\x64\instantclient_11_2\sdk,shared" "--with-sybase-ct=shared" "--enable-couchdb=shared" "--with-couchbase=shared" "--enable-mongo=shared" "--with-imap=shared" "--enable-mailparse=shared" "--enable-pop3=shared" "--with-smtp=shared" "--with-oauth=shared" "--with-ssh2=shared" "--with-snmp=shared" "--enable-uploadprogress=shared" "--enable-http=shared" "--with-imagick=shared" "--enable-discount=shared" "--with-pdflib=shared" "--with-haru=shared" "--with-excel=shared" "--with-enchant=shared" "--enable-printer=shared" "--with-geoip=shared" "--enable-timezonedb=shared" "--with-xdebug=shared" "--enable-suhosin=shared" "--disable-optimizer-plus" "--enable-pthreads=shared" "--enable-pthreads=shared" "--enable-win32service=shared" "--with-memcached=shared" "--enable-memcache=shared" "--enable-apc=shared" "--enable-apc-srwlock-native" "--enable-apc-debug" "--enable-xcache=shared" "--enable-xcache-optimizer" "--enable-xcache-coverager" "--enable-eaccelerator=shared" "--enable-varnish=shared" "--enable-ffmpeg=shared" "--disable-security-flags" </code></pre> <p><strong>openssl</strong> <br></p> <p>OpenSSL support: enabled</p> <p>OpenSSL Library Version: OpenSSL 1.0.1c 10 May 2012</p> <p>OpenSSL Header Version: OpenSSL 1.0.1e 11 Feb 2013</p> </blockquote> <p>PHP 5.6.26</p> <blockquote> <p>Registered Stream Socket Transports: tcp, udp, ssl, sslv3, tls, tlsv1.0, tlsv1.1, tlsv1.2</p> <p>Compiler: MSVC11 (Visual C++ 2012)</p> <p>Architecture: x64</p> <p>Configure Command (compile):</p> <pre><code>cscript /nologo configure.js "--enable-snapshot-build" "--disable-isapi" "--enable-debug-pack" "--without-mssql" "--without-pdo-mssql" "--without-pi3web" "--with-pdo-oci=c:\php-sdk\oracle\x64\instantclient_12_1\sdk,shared" "--with-oci8-12c=c:\php-sdk\oracle\x64\instantclient_12_1\sdk,shared" "--enable-object-out-dir=../obj/" "--enable-com-dotnet=shared" "--with-mcrypt=static" "--without-analyzer" "--with-pgo" </code></pre> <p><strong>openssl</strong> <br></p> <p>OpenSSL support: enabled</p> <p>OpenSSL Library Version: OpenSSL 1.0.1c 10 May 2012</p> <p>OpenSSL Header Version: OpenSSL 1.0.1t 3 May 2016</p> <p>Openssl default config: c:/openssl-1.0.1c-X64/ssl/openssl.cnf</p> <p>openssl.cafile: no value</p> <p>openssl.capath: no value</p> </blockquote>