Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Okay, So I have Xampp installed, and then I have YII installed on localhost inside a directory called "yii". I am now doing a tutorial to learn YII, but I'm stuck on the following page

They say:

Run yiic on the command line as follows:

% YiiRoot/framework/yiic webapp WebRoot/testdrive

What do they mean "run yiic on the command line"? I tried going to localhost/yii/framework/yiic in my browser, but then I get an

Access denied error

share|improve this question

migrated from Oct 15 '12 at 0:12

This question came from our site for professional and enthusiast programmers.

The command line is accessed through the terminal/console. – David Thomas Oct 14 '12 at 16:39
run that command into cmd (command prompt) – GBD Oct 14 '12 at 16:41
What os you are in? If windows, then it is ms dos prompt. – itachi Oct 14 '12 at 16:46
I did that but then I get: "'%' is not recognized as an internal or external command, operable program, or batch file." I'm in in Windows XP btw. – Debrah Oct 14 '12 at 17:14
dont use '%', use the path to your yii application, eg: c:\wamp\www\myyiiapp\framework – eskimo Oct 14 '12 at 17:19

Sounds as if you're having trouble navigating the command prompt. Here are some detailed steps after you've launched the command prompt via cmd:

First, you'll need to change directory to the webroot. The command for that will be:

cd C:\xampp\htdocs\yii\framework

cd stands for change directory, and you're basically doing the same thing you would be doing in Explorer by clicking on My Computer, then C:, then xampp, then htdocs, etc. In fact, you could see a similar process if you ran the follow series of commands, and this is often necessary since you need to list directory contents as you go:

cd c:\
cd xampp
cd htdocs
cd yii
cd framework

Your prompt should then look something like:


From there, you'll want to run the command:

yiic webapp c:\xampp\htdocs\[path_to_where_you_want_the_app]\testdrive    

You could also use a relative path instead of the absolute path I provided.

In general, it sounds as if you'll need to brush up a bit on your command line skills, or you'll be encountering issues like this frequently.

share|improve this answer
Also, consider a couple of quick-read primers on getting used to the command line. Here's one for Windows:… And here's one for Linux:… – Zac B Oct 15 '12 at 16:42

yiic is a command line tool that provides a way to automate some tasks (e.g building skeleton app for you). In windows you get to use it using the command prompt (cmd) & in Unix systems by the terminal.

OK, how about you go to the path where you have Yii installed, you should find a framework directory there, well this is the actual yii framework source. inside that folder you will find two files called yiic but each with different extension, they both do the same job but the one called yiic.bat works for Windows OS & the other for Unix/Linux systems.

So now you know What is it but How to get it work:

Well, it's pretty easy: First You open up the cmd & from there you actually have three ways to do it:

  1. Navigate to the framework folder (using cd) then typeyiic ,
  2. Or, like the syntax in your Q, you write the hole path to the framework directory followed by yic
  3. Or (the neater & most convenient way) you add the path of your framework folder to Windows environment variables, this way you get to call yiic from the cmd wherever your location is


in the command: YiiRoot/framework/yiic webapp WebRoot/testdrive YiiRoot is just an alias, the writer used it because each reader will probably have put the yii source in a diffirent location on his pc so he meant everyone should put their path to yii folder followed by /framework/yiic to run the yiic command tool

webapp is one of yiic command line tool commands to generate an app called testdrive under a directory called WebRoot (which is another alias and should be replaced by path to Web Server Root e.g htdocs for apache). You can build yii apps without using yiic webapp command but it will make things easier and highly recommended for beginners.

share|improve this answer
Thank you for the detailed post... but in this tutorial I need to follow (where I'm stuck right now), right after that step it says the following: "This will create a skeleton Yii application under the directory WebRoot/testdrive. The application has a directory structure that is needed by most Yii applications." Will this actually do that because I don't just need the folder opened though... I don't understand, why did they write the command line as: "% YiiRoot/framework/yiic webapp WebRoot/testdrive" in the tutorial? – Debrah Oct 14 '12 at 19:55
I have updated my answer to cover your comment points. Try to run the command and see what it does, that will answer most of you questions. – Nimir Oct 14 '12 at 20:28
Thank you for trying to help me. I am using Xamp localhost server. My framework folder is located at: C:\xampp\htdocs\yii\framework (and I'm very sure this is right) and my webroot is: C:\xampp\htdocs\ - So now what I do is, I click on start (in winXP), then run, then I type in "cmd" which then gives me a black screen. There I paste: "C:\xampp\htdocs\yii\framework\yiic webapp C:\xampp\htdocs\testdrive" - but then I get this error: "php.exe is not recognized as an internal or external command, operable program, or batch file". Did I do something wrong? – Debrah Oct 14 '12 at 20:43
Check & follow the first answer here:… – Nimir Oct 15 '12 at 7:45

You must log in to answer this question.