Home > php教程 > php手册 > PHP Startup: Unable to load dynamic library

PHP Startup: Unable to load dynamic library

WBOY
Release: 2016-06-13 09:46:25
Original
1891 people have browsed it

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

连接代码

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

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template