Zend -> Warning: is_readable() [function.is-readable]: open_basedir restriction in effect

♀尐吖头ヾ 提交于 2019-12-09 18:32:06

问题


I am getting the following warning in my code:

      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

what is the problem and will it cause problems in deployment and production stage of my application?

Thank you


回答1:


This message appears because since Zend FW 1.10.1 the autoloader creates the path to those files differently. You can find some more information here: Zend FW Bug Report

To get rid of this message you can edit the file index.php and change the set_include_path to this:

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



回答2:


open_basedir is set php is running in safe mode. It restricts you to the folders specified in the list. This might help: http://blog.php-security.org/archives/72-Open_basedir-confusion.html

And yes, you will need to change it on any server if you want to access files outside the default folder.



来源:https://stackoverflow.com/questions/5314957/zend-warning-is-readable-function-is-readable-open-basedir-restriction

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!