PHP linux服务器报错 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/的解决方法!

晚上***.com换空间,搬迁到新的机子上,但是发现重写中http://www.***.com/info/ 和 http://www.***.com/info/public-227636.html 居然全都是直接指向 404文件。

自己检查才发确认重写htaccess中的/info这一段根本就没有生效,但是其他的,如/site /qiye /wuliu /geti 都是生效的。重写文件/.htaccess内容如下:


RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.+)\.(htm|inc)$ – [F,L]


#detail
RewriteRule ^info/public-(\d+).html$ baidu.com/info.php?id=$1 [L]
RewriteRule ^site/free-(\d+).html$ baidu.com/site.php?id=$1 [L]
RewriteRule ^qiye/company-(\d+)/?$ baidu.com/qiye.php?id=$1 [L]
RewriteRule ^wuliu/gongsi-(\d+)/?$ baidu.com/wuliu.php?id=$1 [L]
RewriteRule ^geti/shop-(\d+)/?$ baidu.com/geti.php?id=$1 [L]
RewriteRule ^member/userid-([^\/]+)/?$ baidu.com/member.php?uid=$1 [L]


还发现网站每个有PHP文件的目录下 error_log 文件不停的重复记录这个错误:

[24-Oct-2013 07:10:59 Europe/Moscow] PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/”xcache.so”' - /usr/local/lib/php/extensions/no-debug-non-zts-20090626/”xcache.so”: cannot open shared object file: No such file or directory in Unknown on line 0
[24-Oct-2013 07:10:59 Europe/Moscow] PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/”xcache.so”' - /usr/local/lib/php/extensions/no-debug-non-zts-20090626/”xcache.so”: cannot open shared object file: No such file or directory in Unknown on line 0
[24-Oct-2013 07:10:59 Europe/Moscow] PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/”xcache.so”' - /usr/local/lib/php/extensions/no-debug-non-zts-20090626/”xcache.so”: cannot open shared object file: No such file or directory in Unknown on line 0
[24-Oct-2013 07:10:59 Europe/Moscow] PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/”xcache.so”' - /usr/local/lib/php/extensions/no-debug-non-zts-20090626/”xcache.so”: cannot open shared object file: No such file or directory in Unknown on line 0
[24-Oct-2013 07:11:00 Europe/Moscow] PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/”xcache.so”' - /usr/local/lib/php/extensions/no-debug-non-zts-20090626/”xcache.so”: cannot open shared object file: No such file or directory in Unknown on line 0
[24-Oct-2013 07:11:00 Europe/Moscow] PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/”xcache.so”' - /usr/local/lib/php/extensions/no-debug-non-zts-20090626/”xcache.so”: cannot open shared object file: No such file or directory in Unknown on line 0


测试了很久,把htaccess文件删得只剩下最后那一条重写:

RewriteEngine On
RewriteRule ^info/public-(\d+).html$ baidu.com/info.php?id=$1 [L]


/info的这个重写还是是没有生效,其他的/site /member /qiye /wuliu 依旧是正常的。

真的快找不出原因,最后想到以前使用过的linux空间遇到过这样的情况:“如果htaccess重写涉及的目录真的存在会出错”,仔细找 /info这个目录根本就不存在的。

后来突发奇想,建立一个/info目录试试,结果居然解决了这个问题



------------------------------------------------------------------------------------------------

2013-10-24 补充:

今天偶然来发现,网站根目录下的/error_log文件居然多大了100多MB,而且每时每刻都在不停的增加。

才明白,原来上次解决的只是htaccess 重写问题,但这个的报错依旧是存在的。查阅了很多英文的资料,大部分都说是PHP版本的问题,需修改PHP.INI 或者安装xcache.so。

我的服务器的PHP版本:

PHP Version 5.3.23



现在发现更离谱的是,新建一个目录/a,新增文件 /a/phpinfo.php,访问一次这个phpinfo.php,error_log文件就记录一次:

[24-Oct-2013 07:16:22 Europe/Moscow] PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/”xcache.so”' - /usr/local/lib/php/extensions/no-debug-non-zts-20090626/”xcache.so”: cannot open shared object file: No such file or directory in Unknown on line 0
phpinfo.php全部源码:



如果你也遇到了这个问题,希望回帖或发送邮件告诉我一下解决方法,我的邮箱 [email protected]






你可能感兴趣的:(网站运营,htaccess,PHP有关)