php_openssl.dll 扩展无法加载

php_openssl.dll extension cannot load

我在 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 的路径是正确的。

感谢您的每一次帮助。 问候。

\php.ini

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

extension_dir = "ext"

我删除了 PHP 和 Apache,下载最新版本,进行配置,现在可以使用了。但我没有找到这次失败的正确原因:-(

感谢大家的帮助。