小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

open_basedir restriction in effect的錯誤及其解決辦法

 看見就非常 2014-08-01
 做測試的時候 發(fā)現(xiàn)一個問題。新增加的文章點刪除的時候會出現(xiàn) Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(../license.php) is not within the allowed path(s): (D:/mywebserver/DedeAMPZ/WebRoot/Default) in D:\mywebserver\DedeAMPZ\WebRoot\Default\includes\func\common.inc.php on line 801
Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(../../license.php) is not within the allowed path(s): (D:/mywebserver/DedeAMPZ/WebRoot/Default) in D:\mywebserver\DedeAMPZ\WebRoot\Default\includes\func\common.inc.php on line 806
以上錯誤。 本座初期懷疑是程序本身的問題,資料翻來覆去的看都是沒有解決。都感覺自己腦袋混沌了。狂抽煙,抽了一頓之后。便便了一下。一下就輕松了!~~突然腦袋就清醒了。覺得應該是出現(xiàn)在環(huán)境問題上。檢查了一下阿帕奇和PHP.INI的配置信息。原來真的是環(huán)境的問題  ! 最近剛剛收了個徒弟,順便幫他解決類似問題。下面把同樣的問題也列出來
 問題2:
Warning: Unknown: open_basedir restriction in effect. File(D:/99Game/WEB/htdocs/index.php) is not within the allowed path(s): (D:Game\WEB\htdocs\;C:\WINDOWS\Temp;) in Unknown on line 0
Fatal error: Can't load D:/99Game/WEB/htdocs/index.php, open_basedir restriction. in Unknown on line 0
 
問題3:
Warning: imagegif() [function.imagegif]: open_basedir restriction in effect. File(C:\WINDOWS\TEMP\) is not within the allowed path(s): (C:\PHPnow\htdocs;C:\PHPnow\Temp) in C:\PHPnow\htdocs\hdzs\verify_code.php on line 11
Warning: imagegif() [function.imagegif]: Unable to open temporary file in C:\PHPnow\htdocs\hdzs\verify_code.php on line 11
 
問題4:
虛擬主機,運行一個程序時出現(xiàn)以下錯誤提示:
Warning:   file_exists():   open_basedir   restriction   in   effect.   File(/home/mainwebsite_html/cache/also_purchased-english.cache11548)   is   not   within   the   allowed   path(s):   (/var/web/w0895/:/tmp:/usr/lib/php)   in   /var/web/w0895/html/includes/functions/cache.php   on   line   47  
問題是出現(xiàn)在了PHP.INI上面了 
 原因是php.ini里設置了   
  opendir=/var/web/w0895/:/tmp:/usr/lib/php 

解答:
其實open_basedir 這個是用來限制php的目錄訪問權限什么的,如果不在允許的范圍內,php就不能訪問。
這個 open_basedir 在 php.ini 里可以設定,也可以在 apache的httpd.conf 里面設定

例如:
php_admin_value open_basedir "E:/APMServ5.2.6/www/wordpress/;E:/APMServ5.2.6/tmp/uploadtemp/;"
再比如:
php_admin_value open_basedir =/var/web/w0895/:/tmp:/usr/lib/php
上面問題中的描述,看字面意思好像是open_basedir受到了限制 D:Game\WEB\htdocs\;C:\WINDOWS\Temp; 不屬于允許路徑,php我沒接觸過是不是有個open_basedir的配置文件?是負責目錄權限的?
php程序里的目錄是D:/99Game/WEB/htdocs/index.php,但出錯的目錄是D:Game\WEB\htdocs\
你把D:Game\改成D:\99Game看看

    本站是提供個人知識管理的網(wǎng)絡存儲空間,所有內容均由用戶發(fā)布,不代表本站觀點。請注意甄別內容中的聯(lián)系方式、誘導購買等信息,謹防詐騙。如發(fā)現(xiàn)有害或侵權內容,請點擊一鍵舉報。
    轉藏 分享 獻花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多