Problems Creating First Yii Application

I am using Yii for the first time today. I am currently on 1.3 Creating First Yii Application. This is my yii directory  - C:\wamp\www\YiiRoot, my web root folder - C:\wamp\www and I am using WAMP.

I did cmd from run and typed - "C:\wamp\www\YiiRoot\framework>yiic webapp www\testdrive" and get the error msg -"'php.exe' is not recognized as an internal or external command,

operable program or batch file."

Could somebody please guide me on step by step on how to carry out this instruction - "% YiiRoot/framework/yiic webapp WebRoot/testdrive".

Please check this post:


You need to edit %PATH% environment variable to locate php.exe file.

If you are using Windows XP:

start -> My computer(right click!) -> Advanced Tab -> Environment Variables -> Click Path in System variables -> Edit -> Add you path to your wamp(or xampp) php folder(e.g. ;C:\xampp\php) -> OK


I had the same issue, but now solved after much rumaging through the forum and several links. I think the issue is fundermental and it should be included in the first application setup chapter of the documentation. Thank you.

Should in case somebody else has the issue, added to the explanation giving here

check this out:…th-for-php-cli/

and when ur back to yii, on the commandline, u'll type something like this,

C:\wamp\www\YiiRoot\framework>yiic webapp C:\wamp\www\testdrive

u'll get a prompt:

Create a Web application under 'C:\wamp\www\testdrive'? [Yes|No]

Type y, u'l be good.

Thanks all

Hi y'all

I wrote an article on this topic on my blog:…tml&sl=sv&tl=en

I did also write on how to do this in the cookbook. :)


Cool! Thank you!


I am using Xampp and i have the same problem with my first YII application. Is there anyone online who can walk me through this?



Qiang and others - brilliant effort! I've been around MVC for a while and developed my own but what you appear to have seems excellent.

I came to Yii from a March 2009 review which rates it tops in comparison to what are now regarded as industry standards. I am new to it though and have observed one or two difficulties which you must quickly overcome for newcomers.

One difficulty is installation with XAMPP on an XP machine. It varies from solutions I have seen posted here (and boringly had to hunt elsewhere for) so I've provided some feedback here.

  1. Set WinXP paths.

Start/Settings/Control Panel/System/Advanced. Choose the "Environment Variables" tab at the bottom.

Setting the following in Notepad or other raw text editor will help rule out spelling mistakes…


The first path is a general path to the folder containing php.exe (or whatever name your php file has). The second to the Yii framework contained in the Yii installation batch. Revise it to suit your website name and folder (probably on C: drive, unlike mine which is E:).

If there's only one user only the "System Variables" pane will show. Select "Path from that pane then the Edit button. Copy form the text editor and paste it at the end of the "Variable Value" text string. If there's more than one user then do the same for each, this time entering "Path" in the "Variable Name" text entry field.

  1. Restart machine.

Obvious though this may seem to seasoned pros, the new paths will not be set before system restart!

  1. Test

In Start/Run type cmd (or Start/Programs/Accessories/Command Prompt). Follow the tutorial to test the new installation by making a dummy web application ( by entering "yiic webapp mywebsite", [where mywebsite] can be anything you want to name it for test purposes. It should ask if you want a new website to which, of course, enter "Y".

Now look at the Yii directory tree in Xampp/htdocs/{where you put the install} and you should see a new directory.

Of course, the directory path finally chosen for first test will vary but now play around with installation and other instructions.

Why go into a long and simplistic guide like this? Product branding, that's why.

Guys, you have a great product, kindly made available for others to share. I have little doubt it will become No1 O/S MVC and help a lot of people into the otherwise murky world of MVC architecture. So far as I have seen, it is clearly superior to RoR. To get there though, you need to make entry far more simple than I have seen (feedback, not criticism). People love playing with toys - if they can find where to put the batteries in! This toy took me too long to put the batteries in!

Ex-corporate boss, computer society chairman and now semi-retired, I may have a personal interest in providing assistance. I am introducing a major project to help others. I shall probably use Yii as the framework (that’s after a more than year of testing other systems like RoR). I intend introducing the project to China in November 2009 (partner is Chinese and I have taught many Chinese postgrads). I see this product is known in China, where I hope to employ developers. So, if I can do something to make life easier, why not!  :)

Good luck, xiexie and apologies for the long post! Hope it helps some WinXP/Xampp developers.