0

I'm using the PHP version 7.0.26 on Windows Server 2008R2. I tried to enable the php_openssl.dll extension by following steps in php.ini:

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

Now, when I try which extensions are loaded in command prompt through php -m I see, that php_openssl extension is loaded.

But, when I try to check loaded extension in web browser though method get_loaded_extensions(), the extension is not loaded :-(

In error log, there are following lines:

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.

I'm sure, that path to the php_openssl.dll is correct.

Thanks for each help. Regards.

steelbull
  • 131
  • 4
  • 14
  • *"I'm sure, that path to the php_openssl.dll is correct."* - well, Apache disagrees. – Gordon Nov 30 '17 at 16:26
  • Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Web Applications Stack Exchange](http://webapps.stackexchange.com/), [Webmaster Stack Exchange](http://webmasters.stackexchange.com/) or [Unix & Linux Stack Exchange](http://unix.stackexchange.com/) would be a better place to ask. – jww Nov 30 '17 at 16:32
  • @jww Thanks, I accept it. – steelbull Dec 01 '17 at 07:41
  • @Gordon Yes, its truth. The Apache disagrees. But I'm sure, that the path is correct. But In command prompt the openssh is working! And in browser not. Longer time before, I had the same problem and I solved it. but I don´t remember, how :-D – steelbull Dec 01 '17 at 07:43
  • Hello, steelbull is not the only person who comes across this problem. I have the same problem too. I think there is something wrong will the DLL. Only several dlls are not loading. for me, php_curl.dll and openssl are not loading – Hoy Cheung Aug 19 '18 at 13:48
  • Hi, I changed version of PHP after much hours of searching the solution and problem was solved. – steelbull Jan 30 '19 at 18:31

2 Answers2

1

\php.ini

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

extension_dir = "ext"
veganaiZe
  • 539
  • 5
  • 13
  • Yes, I set the extension dir. Im sure, that extension dir and path to extension dll is correct. – steelbull Feb 17 '18 at 18:00
  • You should run`phpinfo();` to discover which `php.ini` file is actually being used by Apache and that it has both the extension folder set correctly and the extension enabled. – veganaiZe Feb 23 '18 at 17:03
  • I checked the path to php.ini and it was correct. This is second time, when I has the same problem. When I was run php -r print_r(get_loaded_extensions()), there was an another result, like when I put the same php code to test.php. In php command, the extension was loaded and from php file not :-( – steelbull Feb 24 '18 at 19:19
  • Also, I was sure, that the php.ini path was correct, because when I uncomment the line extension=...., in PHP log, I found the failure message and when I comment that extension line, the error message disappeared. – steelbull Feb 24 '18 at 19:22
0

I removed PHP and Apache, download latest versions, configure and now it works. But I do not found right reason of this failure :-(

Thanks for each help.

steelbull
  • 131
  • 4
  • 14
  • Apparently it is probably because their are other dependent DLLs which must befound, as well. So in that case Apache isn't displaying very helpful info in its log. https://stackoverflow.com/a/38417096/5039027 Otherwise it was probably a permission issue. – veganaiZe Mar 02 '18 at 20:50