运行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
评论