PHP Startup: Unable to load dynamic library
-
-
连接代码
echo 'a';
$cn = mysql_connect("localhost",'www.bKjia.c0m','你的mysql用户密码') or die(mysql_error());
if( $cn )
{
echo phpinfo();
}
else
{
echo 'mysql connect fail';
}
?>
因为服务器使用的是安全php.ini所在没有错误显示,于时相看了apache安装目录的logs的errors.log日志文
件发现如下错误
PHP Warning: PHP Startup: Unable to load dynamic library
'D:\myserver\php\ext\php_mysql.dll' - xd5xd2xb2xbbxb5xbdxd6xb8xb6xa8xb5xc4xc4
xa3xbfxe9xa1xa3rn in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library
'D:\myserver\php\ext\php_mysqli.dll' - xd5xd2xb2xbbxb5xbdxd6xb8xb6xa8xb5xc4
xc4xa3xbfxe9xa1xa3rn in Unknown on line 0
[Tue Dec 31 09:05:15 2013] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined
function mysql_connect() in E:\www\a.php on line 2, referer: www.bKjia.c0m[Tue Dec 31 09:05:16 2013] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined
function mysql_connect() in E:\www\a.php on line 2, referer: http://localhost/
[Tue Dec 31 09:05:17 2013] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined
function mysql_connect() in E:\www\a.php on line 2, referer: http://localhost/
[Tue Dec 31 09:06:04 2013] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined
function mysql_connect() in E:\www\a.php on line 3, referer: http://localhost/
[Tue Dec 31 09:06:05 2013] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined
function mysql_connect() in E:\www\a.php on line 3, referer: http://localhost/
[Tue Dec 31 09:06:05 2013] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined
function mysql_connect() in E:\www\a.php on line 3, referer: http://localhost/
[Tue Dec 31 09:06:05 2013] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined
function mysql_connect() in E:\www\a.php on line 3, referer: http://localhost/
[Tue Dec 31 09:06:06 2013] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined
function mysql_connect() in E:\www\a.php on line 3, referer: www.bKjia.c0m
[Tue Dec 31 09:06:06 2013] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined
function mysql_connect() in E:\www\a.php on line 3, referer: http://localhost/
日志中有这么一句
PHP Startup: Unable to load dynamic library 'D:\myserver\php\ext\php_mysql.dll' 这个意思是
没有加载成功php_mysql文件了,还有一点是提示 PHP Fatal error: Call to undefined function
mysql_connect(),,这个是mysql没有连接成功也就是加载mysql库失败了,根据分析有两种可能一是文件不
存在,这个问题不存因为我以前用的是这个php解压包,2是服务器环境变量问题,如果是环境变量有两种解
决办法
1,是直接在windows增加环境变量
2,直接把在d:PHP里找到php5ts.dll,libmysql.dll将其复制到c:/winnt/system32下(winNT/2000的机器),
而winXP/2003是复制到c:/windows/system32下即可
记住复制到system目录之后必须重记apache环境,如我再测试http://localhost/a.php 就可以看到
输出的phpinfo相关信息了,本站原创文章转载注明来源www.bKjia.c0m
更多详细内容请查看:http://www.bKjia.c0m/phper/linux-php/56512.htm
上一篇: 简单介绍Mysql的SQL服务器模式
下一篇: flexbox实现弹性布局的实例分享
推荐阅读
-
Could not load dynamic library cudart64_100.dll
-
Hadoop启动警告:WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... usi
-
WARN util.NativeCodeLoader: Unable to load native-hadoop library for your......
-
WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-
-
【Spark】NativeCodeLoader:62Unable to load native-hadoop library for your platform... using builtin-ja
-
Unable to load native-hadoop library for your platform解决
-
解决 Unable to load native-hadoop library for your platform
-
Hadoop _ 疑难杂症 解决1 - WARN util.NativeCodeLoader: Unable to load native-hadoop library for your plat
-
MAC解决Unable to load native-hadoop library for your platform
-
问题解决:Spark Unable to load native-hadoop library for your platform