note 86578 added to openssl.installation
| From: | mtudorATicefusionremovemeDOTcouk at osu1 dot php dot net | Date: | Fri, 24 Oct 2008 11:52:12 +0000 |
| Subject: | note 86578 added to openssl.installation | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-145690@lists.php.net to get a copy of this message | ||
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.
CAUSE
-----
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.
(http://msdn.microsoft.com/en-us/library/ms682586.aspx)
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.
SOLUTION
--------
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.
Mark.
----
Server IP: 92.48.74.199
Probable Submitter: 90.152.49.58
----
Manual Page -- http://www.php.net/manual/en/openssl.installation.php
Edit -- https://master.php.net/note/edit/86578
Del: integrated -- https://master.php.net/note/delete/86578/integrated
Del: useless -- https://master.php.net/note/delete/86578/useless
Del: bad code -- https://master.php.net/note/delete/86578/bad+code
Del: spam -- https://master.php.net/note/delete/86578/spam
Del: non-english -- https://master.php.net/note/delete/86578/non-english
Del: in docs -- https://master.php.net/note/delete/86578/in+docs
Del: other reasons-- https://master.php.net/note/delete/86578
Reject -- https://master.php.net/note/reject/86578
Search -- https://master.php.net/manage/user-notes.php