昨天帮一朋友配置服务器结果发现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 就可以看到

输出的phpinfo相关信息了,本站原创文章转载注明来源www.111cn.net

更多详细内容请查看:http://www.111cn.net/phper/linux-php/56512.htm

PHP Startup: Unable to load dynamic library的更多相关文章

  1. PHP启动:动态库加载失败(PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/php7/lib/php/extensions/no-debug-non-zts-20151012/*.so')

    今天在linux上面智障一般搞了好久,本来想安装个swoole的,然后用  php -m 的命令想看下安装的PHP扩展库,发现有的扩展库有的可以出来,有的加载失败, 加载失败的错误类型: PHP Wa ...

  2. 安装完 swoole 后出现 PHP Warning: PHP Startup: Unable to load dynamic library 'swoole.so'的解决方法

    安装完 swoole 后出现 PHP Warning:  PHP Startup: Unable to load dynamic library 'swoole.so' (tried: /home/s ...

  3. PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/event.so'

    这是因为启动apche 的时候重复加载了php的动态库模块了, 将:/etc/php.d/ 目录下的event.ini中的内容注释掉或者将文件删除即可

  4. PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_mbstring.dll' 的解决方法

    step 1: cd /etc/php/{$yourphpversion}/cli step 2: sudo vim php.ini step 3: 在extension=php_mbstring.d ...

  5. PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/phalcon.so' - /usr/lib64/php/mod

    这个警告可能是,扩展在php.d里面加载了一遍,然后又在php.ini里写了一遍导致的

  6. PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/redis.so' - /usr/lib64/php/modules/redis.so: undefined symbol: igbinary_serialize in Unknown on line 0

    网上找到两种解决方法, 1.先删除php-pecl-redis,再用pecl install redis 2.安装php-igbinary模块,不过我安装时包冲突了,没有安装成功,所以用了第一种方法

  7. PHP错误日志文件Warning:PHP Startup: Unable to load dynamic library...

    由于我的环境是通过源码编译安装的,安装的时候配置信息和一些其他扩展没安装或设置好: php.err文件一直有这些提示,虽然不影响服务启动,但是看着心好累啊,决定要消灭他们. 问题描述: 出现原因: 上 ...

  8. ***XAMPP:报错 Unable to load dynamic library的解决方法

    A PHP Error was encountered Severity: Core Warning Message: PHP Startup: Unable to load dynamic libr ...

  9. Unable to load dynamic library 'zip.so' on Centos 6.8 useing php7.3

    背景: Centos6.8服务器升级php版本,从7.1升级到7.3,常用扩展都安装完成之后,报:Class 'ZipArchive' not found.一看就是zip扩展没有,需要手动安装了. 中 ...

随机推荐

  1. Spring MVC 中的基于注解的 Controller【转】

    原文地址:http://my.oschina.net/abian/blog/128028 终于来到了基于注解的 Spring MVC 了.之前我们所讲到的 handler,需要根据 url 并通过 H ...

  2. POJ 2157 Evacuation Plan [最小费用最大流][消圈算法]

    ---恢复内容开始--- 题意略. 这题在poj直接求最小费用会超时,但是题意也没说要求最优解. 根据线圈定理,如果一个跑完最费用流的残余网络中存在负权环,那么顺着这个负权环跑流量为1那么会得到更小的 ...

  3. @Required @Autowired @Resource注解详解

    一.@Required注解用于检查特定的属性是否设置 1.RequiredAnnotationBeanPostProcessor 为该注解的处理器,即bean后置处理器,检查所有带有该解的bean属性 ...

  4. IOS键盘的相关设置(UITextfield)

    一.键盘风格 UIKit框架支持8种风格键盘. typedef enum { UIKeyboardTypeDefault,                // 默认键盘:支持所有字符 UIKeyboa ...

  5. HDU 4738 Caocao's Bridges

    Caocao's Bridges Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) ...

  6. MFC学习 文件操作注册表操作

    c读写文件 void CFileView::OnRead() { FILE *pFile = fopen("1.txt", "r"); /*char ch[10 ...

  7. Loadrunner性能指标分析

    Transactions(用户事务分析)----用户事务分析是站在用户角度进行的基础性能分析. Transation Sunmmary(事务综述)----对事务进行综合分析是性能分析的第一步,通过分析 ...

  8. Quartz.Net CronExpression表达式详解

    Quartz.Net是我们常用的开源任务调度程序,其中最方便最强大的功能就是灵活多变的定时任务执行的支持.他靠什么来实现这个灵活的任务定时调度呢,就是咱们今天要详细分享的Cron Express表达式 ...

  9. WebView 获取网页点击事件

    网页上的点击按钮 本身绑定了URL,点击的时候webview 会在下面的这个方法中加载URL - (BOOL)webView:(UIWebView*)webView shouldStartLoadWi ...

  10. Oracle之别名小结

    今天在写一个简单的SQL语句并执行时抛出了如下图所示的一个错误提示信息! 恩,此异常信息很明显,在SQL语句中标示符的长度过长了,简短一些就应该没问题了,我查看了一下我的SQL语句发现是我的查询字段的 ...