Somacon.com: Articles on websites & etc.

§ Home > Index > Troubleshooting

PHP Unable to Load Dynamic Library

How to resolve warning messages when loading dynamic libraries (DLL) (a.k.a extensions) under PHP on Windows.

Problem

When running PHP on Windows XP/2000/2003, you may encounter the following errors that appear in dialog boxes. Additional errors may be printed when running PHP CLI on the command line.

Causes

The most common cause may be a misconfigured extension_dir setting in your php.ini.

You may also encounter the above errors if you enable all the extensions in PHP. The errors are generally caused by misconfigured extensions. Some extensions (e.g. Oracle) require additional setup, software, and support DLLs, which come from outside the main PHP installer.

You may have out-of-date extension DLLs in your extensions directory.

Some extensions may also have bugs that are causing warnings.

The PATH environment variable does not contain the PHP base install location.

IIS may not have been restarted since changes were made to php.ini.

You did not install the correct build of PHP.

The DLL is listed more than once in the php.ini file. (This may be caused by using the MSI installer.)

Solutions

You must configure extension_dir correctly to point to the folder with the DLL files. This setting is edited in your php.ini file. (How to find your php.ini)

Disable all unused DLLs. You can easily disable an extension by commenting-out the corresponding line from your php.ini file. (How to find your php.ini) Comment-out lines by placing a semi-colon at the beginning of the line.

Remove duplicate references to DLLs from your php.ini file.

Make sure you installed the correct version of PHP for your server configuration.

Visit the PHP For Windows Download Page and download the correct ZIP package by following the instructions on the PHP Windows Mannual Installation Steps page under "Selecting and downloading the PHP distribution package". Unzip the file into your PHP installation directory. For example, for PHP 5.2.x + IIS 6 + Windows Server 2003, you need to use the VC6 non-thread safe build. If you get the standard build from the main PHP download page, you will get errors.

If your DLLs versions are out-of-date or mismatched, make sure to download and install the latest Windows binary zip packages as described above.

These errors may also occur if you do not have the Windows PATH environment variable pointing to your base PHP install. In particular, for php_curl.dll, the Windows PATH environment variable must contain the location of the files libeay32.dll and ssleay32.dll. Furthermore, adequate permissions must be granted to those files (usually read permissions to IUSR_MachineName).

Try restarting IIS if you have made changes to php.ini.

If there are still warnings, then you must read the documentation for each enabled extension, and install and configure any necessary third-party software. For example, many database extensions, such as ODBC and Oracle, require third-party software. Look in the "Installation" section of the PHP documentation for the specific extension.

If that fails, try searching for bugs in bugs.php.net for the error message you encounter.

Notes

The MSI installer that comes with PHP 5.2.0 makes it very easy to configure PHP to load all the extensions. This means it is more likely for people to encounter the above issue.

Where is my PHP.ini file?

Go to "Start > Run...", type in cmd and press "OK". Type php --ini and press "Enter". Look for the following line:

Loaded Configuration File:         C:\Program Files\PHP\php.ini

The "Loaded Configuration File" setting tells you which php.ini file PHP is loading. php.ini is generally located in c:\program files\php, c:\windows, or c:\php.

Links

Error Output of php.exe

The following was captured by running PHP CLI with "php -v >out.txt 2<&1" from a Windows XP SP2 command line. This is with all extensions enabled even though most are not used or configured properly.

PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\ext\php_exif.dll' - The specified module could not be found.
in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\ext\php_exif.dll' - The specified module could not be found.
in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\ext\php_ifx.dll' - The specified module could not be found.
in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\ext\php_ifx.dll' - The specified module could not be found.
in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\ext\php_oci8.dll' - The specified module could not be found.
in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\ext\php_oci8.dll' - The specified module could not be found.
in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\ext\php_pdo_oci.dll' - The specified module could not be found.
in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\ext\php_pdo_oci.dll' - The specified module could not be found.
in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\ext\php_pdo_oci8.dll' - The specified module could not be found.
in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\ext\php_pdo_oci8.dll' - The specified module could not be found.
in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\ext\php_pspell.dll' - The specified module could not be found.
in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\ext\php_pspell.dll' - The specified module could not be found.
in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\ext\php_sybase_ct.dll' - The specified module could not be found.
in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\ext\php_sybase_ct.dll' - The specified module could not be found.
in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\ext\php_ibm_db2.dll' - The specified module could not be found.
in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\ext\php_ibm_db2.dll' - The specified module could not be found.
in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\ext\php_imagick.dll' - The specified module could not be found.
in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\ext\php_imagick.dll' - The specified module could not be found.
in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\ext\php_ingres.dll' - The specified module could not be found.
in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\ext\php_ingres.dll' - The specified module could not be found.
in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\ext\php_netools.dll' - The specified module could not be found.
in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\ext\php_netools.dll' - The specified module could not be found.
in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\ext\php_oracle.dll' - The specified module could not be found.
in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\ext\php_oracle.dll' - The specified module could not be found.
in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\ext\php_svn.dll' - The specified module could not be found.
in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\ext\php_svn.dll' - The specified module could not be found.
in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\ext\php_yaz.dll' - The specified procedure could not be found.
in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\ext\php_yaz.dll' - The specified procedure could not be found.
in Unknown on line 0
Cannot find module (IP-MIB): At line 0 in (none)
Cannot find module (IF-MIB): At line 0 in (none)
Cannot find module (TCP-MIB): At line 0 in (none)
Cannot find module (UDP-MIB): At line 0 in (none)
Cannot find module (SNMPv2-MIB): At line 0 in (none)
Cannot find module (SNMPv2-SMI): At line 0 in (none)
Cannot find module (UCD-SNMP-MIB): At line 0 in (none)
Cannot find module (UCD-DEMO-MIB): At line 0 in (none)
Cannot find module (SNMP-TARGET-MIB): At line 0 in (none)
Cannot find module (SNMP-VIEW-BASED-ACM-MIB): At line 0 in (none)
Cannot find module (SNMP-COMMUNITY-MIB): At line 0 in (none)
Cannot find module (UCD-DLMOD-MIB): At line 0 in (none)
Cannot find module (SNMP-FRAMEWORK-MIB): At line 0 in (none)
Cannot find module (SNMP-MPD-MIB): At line 0 in (none)
Cannot find module (SNMP-USER-BASED-SM-MIB): At line 0 in (none)
Cannot find module (SNMP-NOTIFICATION-MIB): At line 0 in (none)
Cannot find module (SNMPv2-TM): At line 0 in (none)
PHP Notice: Constant XML_ELEMENT_NODE already defined in Unknown on line 0

Notice: Constant XML_ELEMENT_NODE already defined in Unknown on line 0
PHP Notice: Constant XML_ATTRIBUTE_NODE already defined in Unknown on line 0

Notice: Constant XML_ATTRIBUTE_NODE already defined in Unknown on line 0
PHP Notice: Constant XML_TEXT_NODE already defined in Unknown on line 0

Notice: Constant XML_TEXT_NODE already defined in Unknown on line 0
PHP Notice: Constant XML_CDATA_SECTION_NODE already defined in Unknown on line 0

Notice: Constant XML_CDATA_SECTION_NODE already defined in Unknown on line 0
PHP Notice: Constant XML_ENTITY_REF_NODE already defined in Unknown on line 0

Notice: Constant XML_ENTITY_REF_NODE already defined in Unknown on line 0
PHP Notice: Constant XML_ENTITY_NODE already defined in Unknown on line 0

Notice: Constant XML_ENTITY_NODE already defined in Unknown on line 0
PHP Notice: Constant XML_PI_NODE already defined in Unknown on line 0

Notice: Constant XML_PI_NODE already defined in Unknown on line 0
PHP Notice: Constant XML_COMMENT_NODE already defined in Unknown on line 0

Notice: Constant XML_COMMENT_NODE already defined in Unknown on line 0
PHP Notice: Constant XML_DOCUMENT_NODE already defined in Unknown on line 0

Notice: Constant XML_DOCUMENT_NODE already defined in Unknown on line 0
PHP Notice: Constant XML_DOCUMENT_TYPE_NODE already defined in Unknown on line 0

Notice: Constant XML_DOCUMENT_TYPE_NODE already defined in Unknown on line 0
PHP Notice: Constant XML_DOCUMENT_FRAG_NODE already defined in Unknown on line 0

Notice: Constant XML_DOCUMENT_FRAG_NODE already defined in Unknown on line 0
PHP Notice: Constant XML_NOTATION_NODE already defined in Unknown on line 0

Notice: Constant XML_NOTATION_NODE already defined in Unknown on line 0
PHP Notice: Constant XML_HTML_DOCUMENT_NODE already defined in Unknown on line 0

Notice: Constant XML_HTML_DOCUMENT_NODE already defined in Unknown on line 0
PHP Notice: Constant XML_DTD_NODE already defined in Unknown on line 0

Notice: Constant XML_DTD_NODE already defined in Unknown on line 0
PHP Notice: Constant XML_ELEMENT_DECL_NODE already defined in Unknown on line 0

Notice: Constant XML_ELEMENT_DECL_NODE already defined in Unknown on line 0
PHP Notice: Constant XML_ATTRIBUTE_DECL_NODE already defined in Unknown on line 0

Notice: Constant XML_ATTRIBUTE_DECL_NODE already defined in Unknown on line 0
PHP Notice: Constant XML_ENTITY_DECL_NODE already defined in Unknown on line 0

Notice: Constant XML_ENTITY_DECL_NODE already defined in Unknown on line 0
PHP Notice: Constant XML_NAMESPACE_DECL_NODE already defined in Unknown on line 0

Notice: Constant XML_NAMESPACE_DECL_NODE already defined in Unknown on line 0
PHP Notice: Constant XML_LOCAL_NAMESPACE already defined in Unknown on line 0

Notice: Constant XML_LOCAL_NAMESPACE already defined in Unknown on line 0
PHP Notice: Constant XML_ATTRIBUTE_CDATA already defined in Unknown on line 0

Notice: Constant XML_ATTRIBUTE_CDATA already defined in Unknown on line 0
PHP Notice: Constant XML_ATTRIBUTE_ID already defined in Unknown on line 0

Notice: Constant XML_ATTRIBUTE_ID already defined in Unknown on line 0
PHP Notice: Constant XML_ATTRIBUTE_IDREF already defined in Unknown on line 0

Notice: Constant XML_ATTRIBUTE_IDREF already defined in Unknown on line 0
PHP Notice: Constant XML_ATTRIBUTE_IDREFS already defined in Unknown on line 0

Notice: Constant XML_ATTRIBUTE_IDREFS already defined in Unknown on line 0
PHP Notice: Constant XML_ATTRIBUTE_ENTITY already defined in Unknown on line 0

Notice: Constant XML_ATTRIBUTE_ENTITY already defined in Unknown on line 0
PHP Notice: Constant XML_ATTRIBUTE_NMTOKEN already defined in Unknown on line 0

Notice: Constant XML_ATTRIBUTE_NMTOKEN already defined in Unknown on line 0
PHP Notice: Constant XML_ATTRIBUTE_NMTOKENS already defined in Unknown on line 0

Notice: Constant XML_ATTRIBUTE_NMTOKENS already defined in Unknown on line 0
PHP Notice: Constant XML_ATTRIBUTE_ENUMERATION already defined in Unknown on line 0

Notice: Constant XML_ATTRIBUTE_ENUMERATION already defined in Unknown on line 0
PHP Notice: Constant XML_ATTRIBUTE_NOTATION already defined in Unknown on line 0

Notice: Constant XML_ATTRIBUTE_NOTATION already defined in Unknown on line 0

Normal output is below.

PHP 5.2.0 (cli) (built: Nov 2 2006 11:57:36)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies

php.ini Loaded Extensions

Below shows relevant portions of php.ini from version 5.2.0.

; Directory in which the loadable extensions (modules) reside.
extension_dir = C:\Program Files\PHP\ext
error_reporting  =  E_ALL
display_startup_errors = On

[PHP_BZ2]
extension=php_bz2.dll
[PHP_CURL]
extension=php_curl.dll
[PHP_DBA]
extension=php_dba.dll
[PHP_DBASE]
extension=php_dbase.dll
[PHP_EXIF]
extension=php_exif.dll
[PHP_FDF]
extension=php_fdf.dll
[PHP_GD2]
extension=php_gd2.dll
[PHP_GETTEXT]
extension=php_gettext.dll
[PHP_GMP]
extension=php_gmp.dll
[PHP_IFX]
extension=php_ifx.dll
[PHP_IMAP]
extension=php_imap.dll
[PHP_INTERBASE]
extension=php_interbase.dll
[PHP_LDAP]
extension=php_ldap.dll
[PHP_MBSTRING]
extension=php_mbstring.dll
[PHP_MCRYPT]
extension=php_mcrypt.dll
[PHP_MHASH]
extension=php_mhash.dll
[PHP_MIME_MAGIC]
extension=php_mime_magic.dll
[PHP_MING]
extension=php_ming.dll
[PHP_MSQL]
extension=php_msql.dll
[PHP_MSSQL]
extension=php_mssql.dll
[PHP_MYSQL]
extension=php_mysql.dll
[PHP_MYSQLI]
extension=php_mysqli.dll
[PHP_OCI8]
extension=php_oci8.dll
[PHP_OPENSSL]
extension=php_openssl.dll
[PHP_PDO]
extension=php_pdo.dll
[PHP_PDO_FIREBIRD]
extension=php_pdo_firebird.dll
[PHP_PDO_MSSQL]
extension=php_pdo_mssql.dll
[PHP_PDO_MYSQL]
extension=php_pdo_mysql.dll
[PHP_PDO_OCI]
extension=php_pdo_oci.dll
[PHP_PDO_OCI8]
extension=php_pdo_oci8.dll
[PHP_PDO_ODBC]
extension=php_pdo_odbc.dll
[PHP_PDO_PGSQL]
extension=php_pdo_pgsql.dll
[PHP_PDO_SQLITE]
extension=php_pdo_sqlite.dll
[PHP_PGSQL]
extension=php_pgsql.dll
[PHP_PSPELL]
extension=php_pspell.dll
[PHP_SHMOP]
extension=php_shmop.dll
[PHP_SNMP]
extension=php_snmp.dll
[PHP_SOAP]
extension=php_soap.dll
[PHP_SOCKETS]
extension=php_sockets.dll
[PHP_SQLITE]
extension=php_sqlite.dll
[PHP_SYBASE_CT]
extension=php_sybase_ct.dll
[PHP_TIDY]
extension=php_tidy.dll
[PHP_XMLRPC]
extension=php_xmlrpc.dll
[PHP_XSL]
extension=php_xsl.dll
[PHP_ZIP]
extension=php_zip.dll
[PHP_APD]
extension=php_apd.dll
[PHP_BCOMPILER]
extension=php_bcompiler.dll
[PHP_BITSET]
extension=php_bitset.dll
[PHP_BLENC]
extension=php_blenc.dll
[PHP_BZ2_FILTER]
extension=php_bz2_filter.dll
[PHP_CLASSKIT]
extension=php_classkit.dll
[PHP_CPDF]
extension=php_cpdf.dll
[PHP_CRACK]
extension=php_crack.dll
[PHP_CVSCLIENT]
extension=php_cvsclient.dll
[PHP_DB]
extension=php_db.dll
[PHP_DBX]
extension=php_dbx.dll
[PHP_DIO]
extension=php_dio.dll
[PHP_DOCBLOCK]
extension=php_docblock.dll
[PHP_DOMXML]
extension=php_domxml.dll
[PHP_EVENT]
extension=php_event.dll
[PHP_FILEINFO]
extension=php_fileinfo.dll
[PHP_FILEPRO]
extension=php_filepro.dll
[PHP_FRIBIDI]
extension=php_fribidi.dll
[PHP_GOPHER]
extension=php_gopher.dll
[PHP_HTTP]
extension=php_http.dll
[PHP_HYPERWAVE]
extension=php_hyperwave.dll
[PHP_IBM_DB2]
extension=php_ibm_db2.dll
[PHP_ID3]
extension=php_id3.dll
[PHP_IISFUNC]
extension=php_iisfunc.dll
[PHP_IMAGICK]
extension=php_imagick.dll
[PHP_INGRES]
extension=php_ingres.dll
[PHP_JAVA]
extension=php_java.dll
[PHP_LZF]
extension=php_lzf.dll
[PHP_MAILPARSE]
extension=php_mailparse.dll
[PHP_MCRYPT_FILTER]
extension=php_mcrypt_filter.dll
[PHP_MEMCACHE]
extension=php_memcache.dll
[PHP_NETOOLS]
extension=php_netools.dll
[PHP_NTUSER]
extension=php_ntuser.dll
[PHP_OGGVORBIS]
extension=php_oggvorbis.dll
[PHP_OPERATOR]
extension=php_operator.dll
[PHP_ORACLE]
extension=php_oracle.dll
[PHP_PARSEKIT]
extension=php_parsekit.dll
[PHP_PDF]
extension=php_pdf.dll
[PHP_PHAR]
extension=php_phar.dll
[PHP_PHPDOC]
extension=php_phpdoc.dll
[PHP_POP3]
extension=php_pop3.dll
[PHP_PRINTER]
extension=php_printer.dll
[PHP_RADIUS]
extension=php_radius.dll
[PHP_RAR]
extension=php_rar.dll
[PHP_SDO]
extension=php_sdo.dll
[PHP_SMTP]
extension=php_smtp.dll
[PHP_SSH2]
extension=php_ssh2.dll
[PHP_STATS]
extension=php_stats.dll
[PHP_STEM]
extension=php_stem.dll
[PHP_SVN]
extension=php_svn.dll
[PHP_SWISH]
extension=php_swish.dll
[PHP_THREADS]
extension=php_threads.dll
[PHP_TIMEZONEDB]
extension=php_timezonedb.dll
[PHP_TRANSLIT]
extension=php_translit.dll
[PHP_WIN32PS]
extension=php_win32ps.dll
[PHP_WIN32SCHEDULER]
extension=php_win32scheduler.dll
[PHP_WIN32SERVICE]
extension=php_win32service.dll
[PHP_WIN32STD]
extension=php_win32std.dll
[PHP_YAZ]
extension=php_yaz.dll
[PHP_ZLIB_FILTER]
extension=php_zlib_filter.dll

Have you heard of the new, free Automated Feeds offered by Google Merchant Center? Learn more in Aten Software's latest blog post comparing them to traditional data feed files.
Created 2006-11-06, Last Modified 2011-07-24, © Shailesh N. Humbad
Disclaimer: This content is provided as-is. The information may be incorrect.