SYMPTOMS AND SETUP
For anyone having problems enabling the PHP openssl extension on WINDOWS.
I uncommented: extension=php_openssl.dll and installed the latest versions of ssleay.dll and libeay.dll in <windows>\system32.
When I restarted my web server and examined phpinfo(), there was no "openssl" headed section (although there were references to openssl in other sections).
I also found this error in my web server logs (<apache dir>/logs/ssl.log and <apache dir>/logs/access.log).
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\Program Files\\PHP\\ext\\php_openssl.dll' - The operating system cannot run %1.\r\n in Unknown on line 0
I have PHP 5.2.6 running on Apache 2.2.3 for Windows.
This was caused by PHP picking up the WRONG VERSIONS of libeay.dll and ssleay.dll, which were present in multiple locations on my computer.
When any application attempts to use a dll file in windows, the system searches for this file using the following order:
1. The directory from which the application loaded.
2. The windows\system32 directory.
3. The windows\system directory.
4. The windows directory.
5. The current directory.
6. The directories that are listed in the PATH environment variable.
For PHP running under Apache, the application directory is <apache dir>\bin and NOT <php dir>. PHP was finding OUT OF DATE versions of libeay.dll and ssleay.dll in <apache dir>\bin (probably installed when I enabled SSL support in my web server). Because of this, the latest versions in windows\system32 were never reached.
NOTE: Although my problem was caused by an Apache2 specific configuration, I can imagine others might face this problem if, say, they install the openssl dlls in the PHP directory and add this directory to the PATH. I haven't checked it but I would imagine if another directory in the path contains outdated openssl dlls and this is listed before the PHP directory, a similar situation would occur.
Either replace the dlls in the first location on the search order, or, as I did, you can install the latest openssl dlls in the the windows system32 directory and just rename to .old the ssleay.dll and libeay.dll files in the search order locations before windows\system32.
Hope that helps others who might be stuck with this.