Jump to content


BloodBaz

Member Since 12 Sep 2017
Offline Last Active Sep 13 2017 06:29 PM
-----

Posts I've Made

In Topic: PHP cURL not running when installed as a Service

13 September 2017 - 06:22 PM

Hi All,

Eventually I found the problem.  File permissions? No.  Path had spaces or was the "extensions" subfolder name too long? No. 

The php_curl.dll file has file dependances to libeay32.dll, libssh2.dll and ssleay32.dll which all reside in the parent (php) folder but without an entry to that folder in your PATH Environment Variable entry, the dll fails to load.

 

Although fixing this is as easy as adding the PATH entry, it does have the problem of tying your path to a specific PHP version which means if you need to switch between PHP versions, you really ought to update your PATH environment variable at the same time.

 

I'm surprised this hasn't been picked up before as both "Running as a Service" and including the php_curl module must both be very common.

I'm running on Windows Server 2016 if that helps.

 

Chris.


In Topic: PHP cURL not running when installed as a Service

13 September 2017 - 06:39 AM

Further to the above, the Apache Error log shows the following warning:

PHP Warning:  PHP Startup: Unable to load dynamic library 'C:/UniServerZ/core/php56/extensions\\php_curl.dll' - The specified module could not be found.\r\n in Unknown on line 0

Clearly the "\\" is the suspect, however other PHP extensions were loaded okay (such as php_openssl, php_intl etc.).

Just for clarity:

  • The file exists: C:\UniServerZ\core\php56\extensions\php_curl.dll
  • "C:\UniServerZ\core\apache2\conf\httpd.conf" does not make any references to "curl" nor any backslashes related to paths.
  • "C:\UniServerZ\core\apache2\conf\extra_us\php56.conf" does not make any references to "curl" nor any backslashes related to paths.
  • "C:/UniServerZ/core/php56/php_production.ini" shows standard relative-path references to extensions as follows:
; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
; extension_dir = "./"
; On windows:
; extension_dir = "ext"
extension_dir = "C:/UniServerZ/core/php56/extensions"
;extension=php_bz2.dll
extension=php_curl.dll
;extension=php_fileinfo.dll
extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_gmp.dll
extension=php_intl.dll

[curl]
; A default value for the CURLOPT_CAINFO option. This is required to be an
; absolute path.
;curl.cainfo =