【问题标题】:Zend -> Warning: is_readable() [function.is-readable]: open_basedir restriction in effectZend -> 警告:is_readable() [function.is-readable]:open_basedir 限制生效
【发布时间】:2011-07-15 22:58:09
【问题描述】:

我的代码中出现以下警告:

      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

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

谢谢

【问题讨论】:

    标签: zend-framework open-basedir


    【解决方案1】:

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

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

    【讨论】:

    • open_basedir 不是安全模式指令。至少 >5.2.x
    【解决方案2】:

    出现此消息是因为自 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'
    );
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-03-06
      • 1970-01-01
      • 1970-01-01
      • 2014-09-27
      • 1970-01-01
      • 1970-01-01
      • 2015-03-30
      • 1970-01-01
      相关资源
      最近更新 更多