出于安全原因,我已经把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