Jump to content
The Uniform Server Community
BloodBaz

PHP cURL not running when installed as a Service

Recommended Posts

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

post-7054-0-60286700-1505262113_thumb.png

Share this post


Link to post
Share on other sites

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 =

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...