Zend - >警告:is_readable()[function.is-readable]:open_basedir限制生效

时间:2011-03-15 16:42:10

标签: zend-framework open-basedir

我的代码中收到以下警告:

      Warning: is_readable() [function.is-readable]: open_basedir restriction in effect.   File(/usr/share/php/./views/helpers/Doctype.php) is not within the allowed path(s): (/var/www/virtual/example.com/:/usr/share/pear/) in /var/www/virtual/example.com/htdocs/rockhopper-v2/library/Zend/Loader.php on line 198

or

      Warning: is_readable() [function.is-readable]: open_basedir restriction in effect.   File(/usr/share/php//var/www/virtual/example.com/htdocs/rockhopper-v2/application/modules/default/views/helpers/Layout.php) is not within the allowed path(s): (/var/www/virtual/example.com/:/usr/share/pear/) in /var/www/virtual/example.com/htdocs/rockhopper-v2/library/Zend/Loader.php on line 198

问题是什么?它会在我的应用程序的部署和生产阶段引起问题吗?

谢谢

2 个答案:

答案 0 :(得分:16)

出现此消息是因为自Zend FW 1.10.1以来,自动加载器以不同方式创建这些文件的路径。您可以在此处找到更多信息:Zend FW Bug Report

要删除此消息,您可以编辑文件index.php并将set_include_path更改为:

set_include_path(
APPLICATION_PATH.'/../library'.PATH_SEPARATOR.
APPLICATION_PATH.'/../library/Zend'
);

答案 1 :(得分:0)

open_basedir设置php正在安全模式下运行。它将您限制为列表中指定的文件夹。这可能会有所帮助:http://blog.php-security.org/archives/72-Open_basedir-confusion.html

是的,如果您想访问默认文件夹以外的文件,则需要在任何服务器上更改它。