PHP Startup: Unable to load Dynamic Library php_openssl.dll The operating sytem cannot run %1

07 Feb 2008
Posted by editor

The process of upgrading PHP on my windows XP system proved to be a painful one, the following error in particular proved difficult to fix or find helpful information on .

PHP Startup: Unable to load Dynamic Library php_openssl.dll The operating sytem cannot run %1

This issue is I believe caused by a mismatch of dll versions. php_openssl.dll is dependant on two other dll's ssleay32.dll and libeay32.dll . Both these dll's should be in your default php directory. The problem however for me was that there was a very much older version of these dlls in the WINDOWS/system32 directory and I believe that somehow these were getting picked up before the ones in the php directory.

Answer: Backup the old ssleay32.dll and libeay32.dll from the system32 directory and then copy in the newer versions from your php directory.

I had some problems copying the files because they were locked by a service and windows would not permit them to be copied over.

Answer: You may not get this problem, but if you do, simply rename the dlls to something like ssleay32.dll.old and libeay32.dll.old and then copy the files in ( I rebooted but you probably don't need to). When I rebooted, the problem was fixed but of course the rogue application that had dumped this old dll into the system32 directory in the first place choked ( unable to find ordinal number in ssleay32.dll ). This turned out to be my Belkin Wireless Monitor program. I will probably remove this software but the quick fix was to copy the old dll's which I had backed up into the belkin monitor application directory. This solution will probably work for other php dll's that show similar errors. Find what the dll's dependencies are, check for other versions of these on the system and then apply the same process using the appropriate dlls. WARNING -- ALWAYS backup the dlls you intend to change from your system directories, if things get messed up they will be your only way back.


Tags: