PHP Startup: Unable to load dynamic library
发布:smiling 来源: PHP粉丝网 添加日期:2014-08-25 16:11:09 浏览: 评论:0
昨天帮一朋友配置服务器结果发现apache日志中有PHP Warning: PHP Startup: Unable to load dynamic library 提示了,然后调试数据库连接发现提示Call to undefined function mysql_connect()错误,这样就想到了是mysql没有加载成功了,下面我们一起来看看问题解决办法.
连接代码:
- <?php
- echo 'a';
- $cn = mysql_connect("localhost",'你的mysql用户名','你的mysql用户密码') or die(mysql_error());//开源代码phpfensi.com
- 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: http://localhost/
- [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: 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: 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相关信息了.
Tags: PHP Startup: Unable to load dynamic
相关文章
- ·ubuntu下安装php5+pdo(2013-11-13)
- ·phpMyAdmin配置安装全攻略(2013-11-13)
- ·win2003 iis整合php后 环境变量无法读取到(2013-11-13)
- ·详解如何正确配置PHP开发环境(2013-11-13)
- ·phpMyAdmin简明安装教程(2013-11-13)
- ·在centos上安装php5.5+MySQL 5.5.32(2013-11-13)
- ·phpmyadmin 配置方法与安装教程(2013-11-28)
- ·Linux下安装MySql+Apache2+PHP5.3.1教程(2013-11-28)
- ·php 5.3环境配置方法(apache2.2 mysql5.1)(2013-11-28)
- ·个人空间上安装phpMyAdmin方法(2013-11-29)
- ·php memcache安装与注意事项(2013-11-29)
- ·需要密码登录phpmyadmin设置方法(2013-11-29)
- ·phpMyAdmin 缺少 mysqli 扩展,请检查 PHP 配置(2013-12-02)
- ·php中不能加载php_mysql.dll、php_mysqli.dll解决方法(2013-12-06)
- ·PHP下免费的加速器,PHPAccelerator(2013-12-10)
- ·为PHP5加入动态Flash文件的生成的支持(2013-12-10)
推荐文章
热门文章
最新评论文章
- 写给考虑创业的年轻程序员(10)
- PHP新手上路(一)(7)
- 惹恼程序员的十件事(5)
- PHP邮件发送例子,已测试成功(5)
- 致初学者:PHP比ASP优秀的七个理由(4)
- PHP会被淘汰吗?(4)
- PHP新手上路(四)(4)
- 如何去学习PHP?(2)
- 简单入门级php分页代码(2)
- php中邮箱email 电话等格式的验证(2)