Creating First Yii Application

Hi

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.

thanks

karthik

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/

hi

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

thanks

Can u post here your directory structure?

hi

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…

thanks

karthik

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

C:/wamp/bin

C:/wamp/php

C:/wamp/php/bin

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

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

rem

rem  @author Qiang Xue <qiang.xue@gmail.com>

rem  @link http://www.yiiframework.com/

rem  @copyright Copyright &copy; 2008 Yii Software LLC

rem  @license http://www.yiiframework.com/license/

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

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

@setlocal

set YII_PATH=%~dp0

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

%PHP_COMMAND% "%YII_PATH%yiic" %*

@endlocal