0

I am using the following configuration on a local machine:

  • PHP 7.4.27
  • Apache 2.4
  • Windows 7 x86 (32 bit)

All the paths are set. All the lines in config files are uncommented. Everything works fine, but when I look at the "site health" WordPress page I see the following:

The following PHP extensions are not found or switched off: curl, gd, imagick.

This doesn't help:

So, what else I can do/check to get these extensions working? Thank you in advance.

pau
  • 352
  • 3
  • 14
  • Are you using WAMP or XAMPP, or did you install PHP and Apache yourself? – Greg Schmidt Jun 16 '23 at 20:50
  • I installed Apache/PHP/MySQL myself – pau Jun 18 '23 at 07:27
  • 1
    Did you install any of the required PHP extensions as part of that process? (https://www.php.net/manual/en/install.pecl.windows.php is a good resource for how to go about installing extensions in general.) Have you enabled them in your `php.ini` file? Did you restart Apache after doing those things? – Greg Schmidt Jun 18 '23 at 18:45
  • I have `extension_dir = "c:\php-7.4.27\ext"` set in `php.ini` and there is `php_curl.dll`. I have the following message in Apache web server error log: `PHP Warning: PHP Startup: Unable to load dynamic library 'curl' (tried: c:\\php-7.4.27\\ext\\curl (The specified module could not be found.), c:\\php-7.4.27\\ext\\php_curl.dll (The specified procedure could not be found.)) in Unknown on line 0`. I can swith on/off _other extensions and it works fine_ (for example, there is no problem loading **gd** after editing `php.ini` - 'extension=gd2`). But with **curl** I am stuck – pau Jun 20 '23 at 19:40
  • And I tried everything from [https://stackoverflow.com/questions/32718133/php-warning-php-startup-unable-to-load-dynamic-library-php-curl-dll-impossibil] - it does not work for me. – pau Jun 20 '23 at 19:45
  • Seems most likely to me that you've got a mismatched version. This is part of why most people use XAMPP to install all of this; it makes sure that things like that don't happen. – Greg Schmidt Jun 21 '23 at 03:15
  • After replacing `nghttp2.dll` in Apache `bin` folder with the same file from PHP folder **curl** extension finaly loaded successfully. Solution - [https://superuser.com/a/1264104] – pau Jun 21 '23 at 19:25

1 Answers1

1

You can see what extensions are loaded with a simple script in your public directory:

<pre><?= print_r(get_loaded_extensions(), TRUE); ?></pre>
James
  • 834
  • 7
  • 27
  • I do not see curl/gd/imagick in the list of loaded extensions - the question is why? – pau Jun 18 '23 at 08:39
  • You'll need to give more details on what you did to install Apache/PHP/MySQL. Did you confirm that the extensions exist where they should? For example, I have XAMPP installed on a Windows machine, and the PHP extension directory is at: `E:\xampp\php\ext`. After you uncommented php.ini for these extensions, did you restart Apache? – James Jun 19 '23 at 06:56
  • I have `php.ini` in `c:\Apache-2.4\bin`. `extension_dir` is uncommented in `php.ini` and is set to `c:\php-7.4.27\ext` and there is `php_curl.dll`. All the necessary dirs are added to system path. I can switch on/off other extensions (restarting web server after editing `php.ini`, of course) and it works fine. – pau Jun 20 '23 at 18:48
  • Do you see the dll files in your PHP ext directory? I'm not sure of the name for imagemagick, but at least php_curl.dll and php_gd.dll? – James Jun 20 '23 at 18:56
  • Yes, I see `php_curl.dll` and `php_gd2.dll` in extension dir. I put `extension=gd2` in `php.ini` and **gd** extension works fine now, but **curl** does not. I have the following message in Apache web server error log: `PHP Warning: PHP Startup: Unable to load dynamic library 'curl' (tried: c:\\php-7.4.27\\ext\\curl (The specified module could not be found.), c:\\php-7.4.27\\ext\\php_curl.dll (The specified procedure could not be found.)) in Unknown on line 0` – pau Jun 20 '23 at 19:23
  • And I tried everything from [https://stackoverflow.com/questions/32718133/php-warning-php-startup-unable-to-load-dynamic-library-php-curl-dll-impossibil] - it does not work for me. – pau Jun 20 '23 at 19:25
  • 1
    Here's a possibly useful topic to try: https://superuser.com/questions/1201346/apache-and-php-curl-issue – James Jun 20 '23 at 21:19
  • 1
    Thanks a lot @James! Replacing `nghttp2.dll` is worked for me (other files listed are not) – pau Jun 21 '23 at 19:28