正文

PHP的open_basedir设置2008-09-16 10:56:00

【评论】 【打印】 【字体: 】 本文链接:http://blog.pfan.cn/daweizhao/38283.html

分享到:

运行PHP脚本时出现了如下错误:

  Warning:   file_exists():   open_basedir   restriction   in   effect.   File(/home/mainwebsite_html/cache/also_purchased-english.cache11548)   is   not   within   the   allowed   path(s):   (/var/web/w0895/:/tmp:/usr/lib/php)   in   /var/web/w0895/html/includes/functions/cache.php   on   line   47

首先在脚本里加上open_basedir设置:#!/home/y/bin/php -d open_basedir= 仍不行

在网上搜查,有三种解决方法,选取了最简单的一种,修改PHP.ini文件中的open_basedir设置

在/home/y下搜索php.ini文件

find ./ -name php.ini

修改open_basedir=./:/tmp,第一个意为在PHP脚本所在的路径和/tmp路径下

运行脚本,OK

 其它三种解决方法如下:http://help.shopex.cn/doc-view-260.html

阅读(2605) | 评论(0)


版权声明:编程爱好者网站为此博客服务提供商,如本文牵涉到版权问题,编程爱好者网站不承担相关责任,如有版权问题请直接与本文作者联系解决。谢谢!

评论

暂无评论
您需要登录后才能评论,请 登录 或者 注册