php_openssl.dll扩展无法加载

时间:2017-11-30 15:50:19

标签: php apache openssl php-extension

我在Windows Server 2008R2上使用的是PHP版本7.0.26。我尝试按照php.ini中的步骤启用php_openssl.dll扩展名:

1. uncomment line: extension=php_openssl.dll
2. set path: extension_dir = "D:/_SERVER/_php7/ext/"
3. copy: php.ini to C:\Windows
4. restart server: httpd -k stop, httpd -k start

现在,当我尝试通过php -m在命令提示符中加载哪些扩展时,我看到,php_openssl扩展已加载。

但是,当我尝试通过方法get_loaded_extensions()检查Web浏览器中的加载扩展时,未加载扩展名: - (

在错误日志中,有以下几行:

The 'Apache2.4' service is restarting.
The 'Apache2.4' service has restarted.
winnt:notice] [pid 376:tid 456] AH00424: Parent: Received restart signal         -- Restarting the server.
[Thu Nov 30 16:47:14.478831 2017] [ssl:warn] [pid 376:tid 456] AH01873:     Init: Session Cache is not configured [hint: SSLSessionCache]
PHP Warning:  PHP Startup: Unable to load dynamic library 'D:/_SERVER/_php7/ext/php_openssl.dll' - The specified module could not be found.\r\n in    Unknown on line 0
[Thu Nov 30 16:47:14.494431 2017] [mpm_winnt:notice] [pid 376:tid 456] AH00455: Apache/2.4.27 (Win32) OpenSSL/1.1.0f PHP/7.0.26 configured -- resuming normal operations
[Thu Nov 30 16:47:14.494431 2017] [mpm_winnt:notice] [pid 376:tid 456] AH00456: Apache Lounge VC15 Server built: Jul  7 2017 11:43:51
[Thu Nov 30 16:47:14.494431 2017] [core:notice] [pid 376:tid 456] AH00094: Command line: 'd:\\_SERVER\\_apache\\bin\\httpd.exe -d D:/_SERVER/_apache'
[Thu Nov 30 16:47:14.494431 2017] [mpm_winnt:notice] [pid 376:tid 456] AH00418: Parent: Created child process 6256
[Thu Nov 30 16:47:14.978047 2017] [ssl:warn] [pid 6256:tid 188] AH01873:     Init: Session Cache is not configured [hint: SSLSessionCache]
PHP Warning:  PHP Startup: Unable to load dynamic library 'D:/_SERVER/_php7/ext/php_openssl.dll' - The specified module could not be found.\r\n in Unknown on line 0
[Thu Nov 30 16:47:15.461662 2017] [mpm_winnt:notice] [pid 6256:tid 188] AH00354: Child: Starting 64 worker threads.
[Thu Nov 30 16:47:17.021712 2017] [mpm_winnt:notice] [pid 3668:tid 188] AH00364: Child: All worker threads have exited.

我确定,php_openssl.dll的路径是正确的。

感谢您的帮助。 问候。

2 个答案:

答案 0 :(得分:0)

<强> \ php.ini中

; Directory in which the loadable extensions (modules) reside.
; On windows:

extension_dir = "ext"

答案 1 :(得分:0)

我删除了PHP和Apache,下载了最新版本,配置,现在它可以工作。但我没有找到这种失败的正当理由: - (

感谢您的帮助。