2012-11-17 34 views
3

在PHP語言的Im初學者。在我的web項目中,我創建了一個filepath.config.ini文件,它將所有文件路徑存儲在網站目錄中。例如。 CLASS1 =斌/ myclass1.php CLASS2 =斌/ myclass2.phpopen_basedir限制效果在php代碼中的錯誤

和IM使用訪問這些路徑:

在本地主機服務器
require $_SERVER['DOCUMENT_ROOT'].'/'.GetfilePath('CLASS1'); 

其工作良好,並給我路徑是這樣

D:/myproject/bin/myclass1.php 

當我上傳這些文件在測試服務器即時通訊獲取此open_basedir限制錯誤。

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/usr/local/apache/htdocs/projectfolder/bin/myclass1.php) is not within the allowed path(s): (/home/:/usr/lib/php:/tmp) 

我知道我們可以禁用此限制......但我不知道該怎麼做:P。 ,但使用此服務器DOCUMENT_ROOT好嗎? 或者是他們使用文件路徑的其他方式?您的人員如何訪問這些文件路徑。 以及如果我禁用open_basedir限制會發生什麼?這樣做是否安全? 請幫我做些什麼?

+0

錯誤指向本地路徑(?):**文件(/usr/local/apache/htdocs/projectfolder/bin/myclass1.php)不在允許的路徑(s)**內 –

回答