出於安全原因,我已經把HTML根下我yii
文件夾,所以我的結構運行網站看起來像這樣open_basedir的限制和子域
/conf
/httpdocs
/httpsdocs
/yii
我實際上得到一個錯誤的open_basedir限制,即yii.php
這是index.php
中調出的httpdocs
不在允許的路徑中。由於這個網站是一個子域名,我是否編輯主域名或子域名的vhosts.conf
?
什麼會正確的設置是允許
/var/www/vhosts/example.com/subdomains/mysubdomain/yii
路徑來訪問?
編輯
所以我/var/www/vhosts/example.com/conf/vhost.conf
文件現在看起來是這樣的:
AddHandler fcgid-script .php
<Directory /var/www/vhosts/example.com/httpdocs>
php_admin_value open_basedir ".:/var/www/vhosts/example.com/subdomains/mysubdomain/httpdocs:/tmp/:/var/www/vhosts/example.com/subdomains/mysubdomain/yii"
FCGIWrapper /var/www/vhosts/example.com/bin/php-cgi .php
Options +ExecCGI +FollowSymLinks
allow from all
</Directory>
我已經重新配置並重新啓動Web服務器,但我仍然得到錯誤:
Warning: require_once() [function.require-once]: open_basedir restriction in effect.
File(/var/www/vhosts/example.com/subdomains/mysubdomain/httpdocs/../yii/yii.php) is not within the allowed path(s):
(/var/www/vhosts/example.com/subdomains/mysubdomain/httpdocs:/tmp)
in /var/www/vhosts/example.com/subdomains/mysubdomain/httpdocs/index.php on line 26
你看:http://us3.php.net/manual/en/ini.core.php #ini.open-basedir? – ldg
對於那些仍在這裏掙扎的人來說是一篇幫助我解決問題的文章:http://prattski.com/2008/09/13/plesk-open_basedir-fix/ – keeg