Ever tried to use HTTPS with PHP and the Zend Framework on Windows, but only received an error for all your troubles? Perhaps an error like:
Unable to Connect to ssl://( your host name):443. Error #175113224: Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
The problem lies in your version of OpenSSL and certain configuration parameters.
HTTPS relies on SSL to transport your data securely and PHP usually uses the OpenSSL implementation of SSL. Problems occur when your versions of OpenSSL are out of sync with each other.
The best option is to always keep ALL of your software 100% up-to-date at all times–but sometimes you are not able to do a full software update for one reason or another.
This is how to ensure OpenSSL works for you:
There are 4 required files for openSSL: libeay32.dll, ssleay32.dll, php_openssl.dll, and openssl.cnf.
libeay32.dll and ssleay32.dll are usually already installed in multiple places, but are usually in different versions. The safest thing to do is rename all the current files and copy in a known version. Make sure you have the most current version by installing the most current version from this site: Shining Light Productions
It is probably best to do a search for these files to see all the locations, but they usually live in the following places on a 64-Bit server:
C:\Program Files (x86)\PHP C:\Program Files (x86)\Apache Group\Apache2\bin C:\Windows\SysWOW64
Go to all of these places and rename the files libeay32-old.dll and ssleay32-old.dll, respectively, then copy libeay32.dll and ssleay32.dll to those locations.
If it doesn’t already exist, copy php_openssl.dll to:
C:\Program Files (x86)\PHP\ext
If you do not have php_openssl.dll, one place to find it is here.
If it doesn’t already exist, copy openssl.cnf to:
C:\Program Files (x86)\PHP\extra\openssl
Create directories if they do not already exist. If you do not have openssl.cnf, you can download PHP’s default cnf file here.
Add the following line to php.ini:
extension=php_openssl.dll
Make sure the following line is uncommented in httpd.conf:
LoadModule ssl_module modules/mod_ssl.so
Restart Apache.
You’re done!