Jump to content


Photo

PHP cURL not running when installed as a Service


  • Please log in to reply
3 replies to this topic

#1 BloodBaz

BloodBaz

    Newbie

  • Member
  • Pip
  • 4 posts
  • Main OS: Windows 10

Posted 12 September 2017 - 07:21 PM

Hi,

I'm running UniServer Zero XIII 13.3.2 with PHP 5.6.30 to run an old Moodle 2.7 site.

 

Moodle 2.7 requires php_curl (among other extensions) which I can configure in UniServer and when I run the Moodle site, the Site Administration > Server > Environment confirms that all required php extensions (including curl) are all OK.

 

I then stop the Apache and MySQL servers in UniServer Zero and install and run both as a service using UniService.exe (UniService XIII 2.2.0).  

Everything installs, Moodle runs but the same environment check says:

 

 

php_extension curl must be installed and enabled

The cURL PHP extension is now required by Moodle, in order to communicate with Moodle repositories.

Check

(see image)

 

All other extensions are OK. 

When I stop/uninstall and the launch services via UnIController.exe, everything is okay again.

 

I've ran the UnIService "Apache service test" but no errors were highlighted.  Can anyone advise on what I should do to fix this?

 

Thanks,

Chris

Attached Files



#2 BloodBaz

BloodBaz

    Newbie

  • Member
  • Pip
  • 4 posts
  • Main OS: Windows 10

Posted 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 =


#3 BloodBaz

BloodBaz

    Newbie

  • Member
  • Pip
  • 4 posts
  • Main OS: Windows 10

Posted 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.



#4 olajideolaolorun

olajideolaolorun

    Project Manager

  • Admin
  • PipPipPipPipPip
  • 2,344 posts
  • Gender:Male
  • Location:Atlanta, GA
  • SourceForge IDempirex
  • Wiki ID: olajideolaolorun
  • IRC Nickname: Olajide
  • Main OS: Windows 10

Posted 26 September 2017 - 02:48 AM

Thanks for the follow up. Sorry for the late response. 






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users