[Tutorial] How to install Yii on Windows


I was having a hard time figuring out how to install Yii on my Windows machine. Then I found this blog entry but it didn’t completely work for me. I got stuck at step 18 because the command line can’t find php.exe.


Open yiic.bat with notepad and put the complete path to your php.exe, like this:

if "%PHP_COMMAND%" == "" set PHP_COMMAND=C:\wamp\bin\php\php5.3.0\php.exe

Save and apply step 18 again. BTW, you can skip steps 1 to 12.

Hope it helps.


You can also set PHP_COMMAND globally as an environment variable, and not touch yiic.php ever.


How? i try it but without success!! i insert a new variable : "PHP_COMMAND" with value = "C:\xampp\php\"…

Thanks !!

Depends on the operating system. Google "set environment variable [OS]". Also, I do not know the path of php on xampp

for those of you who haven’t figured it out yet,

create a folder called testdrive in your web root

say your web root is at c:/wamp/www

and you yii root is at c:/yii

1 . open windows command line

2 . type

c:/wamp/bin/php/php5.3.0/php.exe c:/yii/framework/yiic.php webapp testdrive

once done, you should have all the files inside testdrive

[size=2]Thank you, I had the same problem. It helped. Only: 1B. cd c:/wamp/www[/size]

[size=2]thanks abdul your suggestion worked for me[/size]

@ AbdullahSZ

Great! Thanks! After trying many tutorials this one finally worked for me.