open_basedir restriction after installing Yii


Please help. I’ve read many topics, describing the problems similar to mine, but i haven’t found the solution for my problem.

The problem is that after intalling Yii application on the server, when i start the application for the first time, it is loading fine, I can see the start page. But after clicking any link or just refreshing the page, I get an error:

include() [<a href='function.include'>function.include</a>]: open_basedir restriction in effect. File() is not within the allowed path(s):

After server restarting everything is the same - for the first time the starting page is loaded, and then i have the error.

What may be the problem?

Thx a lot.

in your main config file ,how did you define your base it skeleton application generated by yiic console command?

yes, after running yiic tool I’ve nothing changed at main.php. So the basePath varialbe is defined as follows:


which IDE(Integrated Development Environment) you are using on which Operating System?

well, on my local machine running under WinXP I’m using Aptana, and as for my local machine, everything works fine.

As for remote server - it’s running under Debian. Both server are Apache.

But I don’t understand how can IDE affect perfomance of the application on the remote server?

As I’ve mentioned above, after I restart remote server the application is beeing loaded fine. But after refreshing the page it’s showing the error. It seems, that after first initialisation the server is rewriting some constant value of some path, needed for the apllication…

could you please give the screen shot?

if you put your application base directory and Yii framework directory in the same level,you may overcome your problem.

other wise you have to point your framework base path explicitly in main.php config file .


you can check it out for more details related to your problem


I have the same problem, but this method does not work. Any other suggestions?

might be it’s too late to response your problem!whatever,if your web-server is [font=“Arial,”]the Apache,you can prevent open base directory restriction problem by the httpd.conf like the following way…[/font]



<Directory /your domain/httpdocs>

php_admin_value open_basedir "your directory path(url)"


however you can completely remove the restriction like,

<Directory /your domain/httpdocs>

php_admin_value open_basedir none



[font="Arial,"][size="2"]note that the values in the open_basedir are prefixes, which means that anything under the "/your domain/your specific directory"will be accessible.[/size][/font]

[font=“Arial,”][size=“2”]if it doesn’t solve your problem,please reply me.[/size][/font]



If you can’t turn it off - some shared hosts have it enabled - the only way you can install a Yii app on that type of host is to put Yii in the base directory: