php_gd2 extension not loading on Windows

My PHP 8.0.6 installation on Windows Server 2019 is logging the following error:

PHP Startup: Unable to load dynamic library 'php_gd2.dll' (tried: C:\Program Files (x86)\PHP\php-8.0.6-nts-Win32-vs16-x86\ext\php_gd2.dll (The specified module could not be found), C:\Program Files (x86)\PHP\php-8.0.6-nts-Win32-vs16-x86\ext\php_php_gd2.dll.dll (The specified module could not be found)) in Unknown on line 0

The php.ini extension_dir entry is:

; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
;extension_dir = ./
; On windows:
extension_dir = C:\Program Files (x86)\PHP\php-8.0.6-nts-Win32-vs16-x86\ext

That is the correct folder, and as you can see below, the php_gd2.dll file does exist:

C:\Program Files (x86)dir C:\Program Files (x86)\PHP\php-8.0.6-nts-Win32-vs16-x86\ext
 Volume in drive C has no label.
 Volume Serial Number is 08A0-94D0

 Directory of C:\Program Files (x86)\PHP\php-8.0.6-nts-Win32-vs16-x86\ext

05/21/2021  07:53 PM    DIR          .
05/21/2021  07:53 PM    DIR          ..
05/04/2021  05:02 PM            67,072 php_bz2.dll
05/04/2021  05:02 PM            76,800 php_com_dotnet.dll
05/04/2021  05:02 PM           508,928 php_curl.dll
05/04/2021  05:02 PM           114,688 php_dba.dll
05/04/2021  05:02 PM            20,480 php_enchant.dll
05/04/2021  05:02 PM            58,368 php_exif.dll
05/04/2021  05:02 PM           134,656 php_ffi.dll
05/04/2021  05:02 PM         6,737,920 php_fileinfo.dll
05/04/2021  05:02 PM            45,568 php_ftp.dll
05/04/2021  05:02 PM         1,461,248 php_gd.dll
03/01/2019  11:11 AM         1,445,888 php_gd2.dll
05/04/2021  05:02 PM            45,056 php_gettext.dll
05/04/2021  05:02 PM           257,536 php_gmp.dll
05/04/2021  05:02 PM           827,392 php_imap.dll
05/04/2021  05:02 PM           294,912 php_intl.dll
05/04/2021  05:02 PM           202,240 php_ldap.dll
05/04/2021  05:02 PM         1,363,456 php_mbstring.dll
05/04/2021  05:02 PM            89,088 php_mysqli.dll
05/04/2021  05:02 PM           121,344 php_oci8_12c.dll
05/04/2021  05:02 PM           121,344 php_oci8_19.dll
05/04/2021  05:02 PM            51,712 php_odbc.dll
05/04/2021  05:02 PM         1,294,336 php_opcache.dll
05/04/2021  05:02 PM           122,880 php_openssl.dll
05/04/2021  05:02 PM            28,160 php_pdo_firebird.dll
05/04/2021  05:03 PM            26,112 php_pdo_mysql.dll
05/04/2021  05:03 PM            30,208 php_pdo_oci.dll
05/04/2021  05:03 PM            22,528 php_pdo_odbc.dll
05/04/2021  05:03 PM            35,328 php_pdo_pgsql.dll
05/04/2021  05:03 PM            24,064 php_pdo_sqlite.dll
05/04/2021  05:02 PM            91,648 php_pgsql.dll
05/04/2021  05:02 PM            15,360 php_phpdbg_webhelper.dll
05/04/2021  05:02 PM            14,848 php_shmop.dll
05/04/2021  05:02 PM           357,376 php_snmp.dll
05/04/2021  05:03 PM           210,944 php_soap.dll
05/04/2021  05:02 PM            60,928 php_sockets.dll
05/04/2021  05:02 PM            59,904 php_sodium.dll
05/04/2021  05:02 PM            39,424 php_sqlite3.dll
05/04/2021  05:02 PM            15,872 php_sysvshm.dll
05/04/2021  05:02 PM           651,776 php_tidy.dll
03/01/2019  11:11 AM            67,584 php_xmlrpc.dll
05/04/2021  05:03 PM           232,448 php_xsl.dll
05/04/2021  05:02 PM            22,528 php_zend_test.dll
              42 File(s)     17,469,952 bytes

I've tried specifying the slashes in the path using forward slash (/) instead of back slash (\), which has no effect; the error persists.

What do I need to do to be able to load php_gd2.dll?

Topic php.ini php Wordpress

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.