解决PHP startup: Unable to load dynamic library的错误

作者:网络 来源:佚名 更新时间:2008-05-07 16:41:27 点击:

怪啦!今天的apache和iis都没法正确加载php_mysql.dll。google了一下,原来发现出现这个问题的人还不少,php startup: unable to load dynamic library :e;\php5\ext\php_mysql.dll。明明php_mysql.dll就摆在extension_dir (= "e:/php5/ext")下的嘛,怎么会呢?而且就在php_mysql.dll之前的extension=php_gd2.dll都没有出现这个问题,怪了!有人说copy libmysql.dll到 %windir%\system32下就可以解决问题,其实"华山不这一条道":

 

php被我挪了个窝,%programfiles%到e:\下,导致一些要依赖于其他dll才能工作的扩展无法正常加载这些dll,出现加载扩展出
错,以刚才的php_mysql.dll为例,php_mysql依赖libmysql.dll,由于给php5挪窝了,而又没有把新的e:\php5夹道%path%中去
,所以没法找到这个libmysql.dll,才会出错。所以为了能够使用这些mysql的扩展,除了要正确地配置extension_dir外
,还得保证系统能够这些扩展所依赖的dll,解决的办法有两个:
1 将这些依赖的dll拷贝到%windir%\system32下
2 或者将php5的安装目录添加到%path%中。
无论那个都可以很好地达到我们地目的。
够简单的,但是有时候还就想不到哪儿去。
到底哪些扩展依赖哪些dll呢?以下列表可以帮助我们回答这个问题:
php_curl.dll curl, client url library functions requires: libeay32.dll, ssleay32.dll (bundled)
php_domxml.dll dom xml functions php <= 4.2.0 requires: libxml2.dll
(bundled) php >= 4.3.0 requires: iconv.dll (bundled)
php_fdf.dll fdf: forms data format functions. requires: fdftk.dll
gnu_gettext.dll (bundled), php >= 4.2.3 requires libintl-1.dll,
php_iconv.dll iconv characterset conversion requires: iconv-1.3.dll
php_ingres.dll ingres ii functions requires: ingres ii libraries
php_interbase.dll interbase functions requires: gds32.dll (bundled)
php_java.dll java functions php <= 4.0.6 requires: jvm.dll (bundled)
php_ldap.dll ldap functions php <= 4.2.0 requires libsasl.dll(bundled),
php >= 4.3.0 requires libeay32.dll,ssleay32.dll (bundled)
php_mcrypt.dll mcrypt encryption functions requires: libmcrypt.dll
php_mhash.dll mhash functions php >= 4.3.0 requires: libmhash.dll (bundled)
php_mcrypt.dll mcrypt encryption functions requires: libmcrypt.dll
php_mhash.dll mhash functions php >= 4.3.0 requires: libmhash.dll (bundled)
php_msql.dll msql functions requires: msql.dll (bundled)
php_mssql.dll mssql functions requires: ntwdblib.dll (bundled)
php_mysql.dll mysql functions php >= 5.0.0, requires libmysql.dll (bundled)
php_mysqli.dll mysqli functions php >= 5.0.0, requires libmysqli.dll (bundled)
php_oci8.dll oracle 8 functions requires: oracle 8.1+ client libraries
php_openssl.dll openssl functions requires: libeay32.dll (bundled)
php_oracle.dll oracle functions requires: oracle 7 client libraries
php_sybase_ct.dll sybase functions requires: sybase client libraries
php_xmlrpc.dll xml-rpc functions php >= 4.2.1 requires: iconv.dll (bundled)
php_xslt.dll xslt functions php <= 4.2.0 requires sablot.dll, expat.dll (bundled).
php >= 4.2.1 requires sablot.dll, expat.dll, iconv.dll (bundled).