标签:
LAMP环境,项目运行错误日志路径:/var/log/httpd
错误日志例如:
[Sat Jul 11 16:51:24 2015] [error] [client 192.168.17.3] PHP Warning: include_once(): open_basedir restriction in effect. File(/var/www/website/config/config.php) is not within the allowed path(s): (.:/tmp/) in /var/www/website/mode/upload/uploadajax.php on line 3, referer: http://192.168.100.145/?m=index [Sat Jul 11 16:51:24 2015] [error] [client 192.168.17.3] PHP Warning: include_once(/var/www/website/config/config.php): failed to open stream: Operation not permitted in /var/www/website/mode/upload/uploadajax.php on line 3, referer: http://192.168.100.145/?m=index [Sat Jul 11 16:51:24 2015] [error] [client 192.168.17.3] PHP Warning: include_once(): Failed opening ‘../../config/config.php‘ for inclusion (include_path=‘.:/usr/share/pear:/usr/share/php‘) in /var/www/website/mode/upload/uploadajax.php on line 3, referer: http://192.168.100.145/?m=index [Sat Jul 11 16:51:24 2015] [error] [client 192.168.17.3] PHP Notice: Undefined variable: rock in /var/www/website/mode/upload/uploadajax.php on line 4, referer: http://192.168.100.145/?m=index [Sat Jul 11 16:51:24 2015] [error] [client 192.168.17.3] PHP Fatal error: Call to a member function now() on a non-object in /var/www/website/mode/upload/uploadajax.php on line 4, referer: http://192.168.100.145/?m=index
出现该错误,需要修改php.ini
; open_basedir, if set, limits all file operations to the defined directory ; and below. This directive makes most sense if used in a per-directory ; or per-virtualhost web server configuration file. This directive is ; *NOT* affected by whether Safe Mode is turned On or Off. ; http://www.php.net/manual/en/ini.sect.safe-mode.php#ini.open-basedir open_basedir = .:/
参考:php错误提示 open_basedir restriction in effect 解决
标签:
原文地址:http://www.cnblogs.com/bmbh/p/4639068.html