requirments failure on Nginx server

ive been trying to get Yii running on a Centos based server running Nginx with php through Fastcgi but am having difficulty. i have php running and already have a wordpress blog up and running so php/nginx are configured correctly (at it is for wp anyway)

when i go to the requirements page i get the following

$_SERVER variable  Failed  Yii Framework  $_SERVER does not have SCRIPT_NAME.

I've searched and search but have not found anything in the documentation/forum/web directly relating to this issue.

I can create an application and Yiic will successfully create the app but I get the following PHP error

PHP Error


Undefined index: SCRIPT_NAME

Source File


which is a reference in the public function getScriptUrl. If someone could point me in the right direction as to how I solve/workaround this that would great. im thinking its something mis-configured in my php.ini?

ok maybe im alone in this one (whio knows) can someone maybe post there settings if they have yii successfully running on nginx, did you have to make any changes to your nginx.conf/virtual host setting/php.ini? i would really like to get yii running and give it a chance…

May be it is related to this http://open.emspace…-and-scriptname ?

thank you Wei, this has gotten me part way to getting yii running im sure ill sort it out eventually

I am having the same problem ($_SERVER variable in requirements page) with Vista64 and IIS 7. Does anyone know what causes this or what it means

I found that the problem (at least with IIS) is that the REQUEST_URI variable does not exist. I found a post that appears to fix this at

However, I’m wondering how this var not being in IIS will affect the yii framework. If the code I found can be used to fix the issue globally or if it would have to be applied across the framework. I’m new to Yii and would like to investigate using this framework but some of my clients use linux hosting others use windows, so I don’t get to choose this requirement. It seems that this would be something that could be simple to fix but I don’t know. Any comments?

I guess the architecture of apache and nginx server is very different.

and we know that YiiFramework is using $_SERVER variable in base application code (try to find out into core application class) you will found a script that contains or calling $_SERVER variable.

that’s will be same happen if yii run on difference architecture with apache server.

that is my opinion…

let me know if I was wrong …