Allowing WebRoot-Directory Access to overlying Directory
I am trying to setup the php yii-framework on a virtual server (ubuntu).
- The yiiframework is placed in
/var/www/yii-1.1.7/framework/
. - The webroot is
/var/www/vhosts/domainname/httpdocs/
. - The command
yiic.php webapp /var/www/vhosts/domainname/httpdocs/appname
successfully creates the directory with the corres开发者_开发知识库ponding appname in the desired webroot folder. - The pages in the folder do however result in a 500 internal Server Error.
Since the framework folder obviously has the necessary rights to write the demanded files into the webroot (I double checked that all the files are created as expected) I suspect it must be some sort of issue that comes from the webroot not having the needed access to the overlying framework directory.
Does anybody have any idea how to change the corresponding config files so that this can work?
As your error log shows "open_basedir restriction in effect." you can't really include anything outside from your basedir or outside from webroot in this server without changing the php configuration open_basedir variable
In your index.php file located in your yii application's main folder there is a line that should look like this:
$yii=dirname(__FILE__).'/../../../../yii-1.1.7/framework/yii.php';
This is your index bootstrap file. All yii requests flow through this point. This file needs to know where the framework resources are. That's what the path above is about.
精彩评论