duanjue2576 2013-07-02 14:00
浏览 47

当我尝试打开我的网页时,我得到'open_basedir限制生效'[重复]

This question already has an answer here:

I'm getting this error from host server:

Warning: Unknown: open_basedir restriction in effect. File(/www/zxq.net/k/u/p/kuptoje/htdocs/index.php) is not within the allowed path(s): (VIRTUAL_DOCUMENT_ROOT) in Unknown on line 0

Warning: Unknown: failed to open stream: Operation not permitted in Unknown on line 0

Fatal error: Unknown: Failed opening required '/www/zxq.net/k/u/p/kuptoje/htdocs/index.php' (include_path='.:/usr/lib/php') in Unknown on line 0
</div>
  • 写回答

1条回答 默认 最新

  • dsrnwngq411594 2013-07-02 14:09
    关注

    Some hosts set an open_basedir restriction. This means that only files from inside the set include_path are allowed.

    your include_path is set to '/usr/lib/php' but you are trying to require a file from '/www/zxq...' and that is not in the allowed include_path.

    Solutions are to set open_basedir off or to add your '/www' folder to the open_basedir include_path. this should be done in your php.ini file (often located at /etc/php.ini) There you simply add the /www directory to you php.ini file. e.g. include_path='.:/usr/lib/php:/www/zxq.net'

    If you don't have access to your php.ini file you can try setting it in php: http://php.net/manual/en/function.set-include-path.php if that doesn't work they don't allow you to edit the include_path. Contact your host and let them fix the problem.

    EDIT: as linked to in the comments. See this thread for more info: open_basedir restriction in effect. File(/) is not within the allowed path(s):

    评论

报告相同问题?

悬赏问题

  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题
  • ¥15 linux驱动,linux应用,多线程
  • ¥20 我要一个分身加定位两个功能的安卓app
  • ¥15 基于FOC驱动器,如何实现卡丁车下坡无阻力的遛坡的效果
  • ¥15 IAR程序莫名变量多重定义
  • ¥15 (标签-UDP|关键词-client)
  • ¥15 关于库卡officelite无法与虚拟机通讯的问题
  • ¥15 目标检测项目无法读取视频
  • ¥15 GEO datasets中基因芯片数据仅仅提供了normalized signal如何进行差异分析
  • ¥100 求采集电商背景音乐的方法