Installing Yii App to webroot

Hi all,

I’m trying to install a yii app to the webroot of a subdomain, i.e:

However when I do this I just get a blank page, I’ve tried searching on this and I can’t find any solutions.

My directory structure looks like this:


And the framework files are located at:


In that directory I’ve tried running:

php yiic.php webapp ../../httpdocs

This creates all the directories perfectly and everything is there, but when I navigate to it’s just a blank screen.

I had a look at the /protected/config/main.php file and it had set the file path for $yii to the wrong place, so I fixed this to call from the correct place but still no luck, just a white screen.

If I try to install the yii app into a directory in the httpdocs then all works perfectly, so:

php yiic.php webapp ../../httpdocs/myapp

creates the app in and all runs great, but I don’t want it in a directory, I want it to run in the root of the web accessible files.

Does anyone have any ideas?



Check the php error logs and/or web server error logs.

Hi wei,

I’ve had a look, there are no php error logs that I can see and the last entry in the main logs is a “file has no execute permission: (/path/to/other/domain/)” but for another domain and on 7th April 2011, so I guess not something I did this morning!

I’ll see if I can find a setting for php to output errors to an error log file in the directory, as I don’t see one at the mo, other than that, not sure what else it could be.

Good start would be to enable error reporting in your index.php file(or even .htaccess file, depending on your host configuration), so you will probably get more information about errors. It is possible that error reporting is disabled by your host(in php.ini file).

Of course, I thought it was turned on, oops!

Warning: require_once() [function.require-once]: open_basedir restriction in effect. File(/path/to/subdomain/foo/httpdocs/../yii/framework/yii.php) is not within the allowed path(s): (/path/to/subdomain/foo/httpdocs:/tmp) in /path/to/subdomain/foo/httpdocs/index.php on line 14

Wonder why that didn’t show up in the error logs… never mind, that’s something to fix later!

But back to the point here, is it a security risk to add that dir to the open_basedir? As the only reason I want the framework under the webroot is for security, and if putting the framework directory in the open_basedir is going to open it up to anyone, then that kind of defeats the point in the first place?

Any suggestions on how this is meant to be done? lol