网站地图    收藏   

主页 > 后端 > PHP语言 >

PHP Startup: Unable to load dynamic library_自学php网

来源:自学PHP网    时间:2014-12-04 21:50 作者: 阅读:

[导读] 昨天帮一朋友配置服务器结果发现apache日志中有PHP Warning: PHP Startup: Unable to load dynamic library 提示了,然后调试数据库连接发现提示Call to undefined function mysql_connect()错误,这样就想到了是...

昨天帮一朋友配置服务器结果发现apache日志中有PHP Warning: PHP Startup: Unable to load dynamic library 提示了,然后调试数据库连接发现提示Call to undefined function mysql_connect()错误,这样就想到了是mysql没有加载成功了,下面我们一起来看看问题解决办法。
-
-

连接代码

<?php
echo 'a';
$cn = mysql_connect("localhost",'www.111cn.net','你的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.111cn.net[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.111cn.net

[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 就可以看到
 

自学PHP网专注网站建设学习,PHP程序学习,平面设计学习,以及操作系统学习

京ICP备14009008号-1@版权所有www.zixuephp.com

网站声明:本站所有视频,教程都由网友上传,站长收集和分享给大家学习使用,如由牵扯版权问题请联系站长邮箱904561283@qq.com

添加评论