Creating First Yii Application


I have installed yii in my localhost.

path is like this : c:/wamp/www/yii

How to run path in command prompt? I was tried many way like below path

c:/wamp/www/yii/framwork/yiic.php webapp WebRoot/testserver

But i didn't get any thing…

I was try to run in browser… path is http://localhost/testdrive/index.php

I got the below error

Not Found

The requested URL /testdrive/index.php was not found on this server.

Please any one explain to me. Whats the problem.



As I understood, c:/wamp/www is your DirectoryRoot.

You should run in command promt(Start-Run->cmd.exe) something like this

php c:/wamp/www/yii/framework/yiic.php webapp c:/wamp/www/testdrive

** replace php with your path to php.exe (look in c:/wamp/*)

After that it should create test app that can be accessible with http://localhost/testdrive/


can u explain clearly. how to set the path in command prompt. I was tried many way its not working.


Can u post here your directory structure?


I have installed wamp in localhost server.

Path is C:/wamp/www

I have installed yii frame work inside the wamp

path is C:/wamp/www/yii

Please find attachment…

whats wrong i did…



You should find where your php.exe is located. I don't know the structure of wamp. Maybe it's somewhere like:




Then Run in directory of yii:

YOUR_PATH_TO/php.exe yiic.exe webapp C:/wamp/www/testdrive

After that you will have basic Yii framework based application which can be found with http://localhost/testdrive

Good luck. Enjoy Yii :)

Edit C:\wamp\www\yii\framework\yiic.bat and change the PHP_COMMAND as shown.

Now you can follow the documentation for the first app as written.

@echo off

rem -------------------------------------------------------------

rem  Yii command line script for Windows.


rem  This is the bootstrap script for running yiic on Windows.


rem  @author Qiang Xue <>

rem  @link

rem  @copyright Copyright &copy; 2008 Yii Software LLC

rem  @license

rem  @version $Id: yiic.bat 2 2008-09-28 12:03:53Z qiang.xue $

rem -------------------------------------------------------------


set YII_PATH=%~dp0

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