Difference between #3 and #2 of How to setup yiic on WAMP (XP/Vista)

Setting up yiic on WAMP (Vista)
This page assumes that you have installed
[Wampserver](http://www.wampserver.com/en/ "Download wampserver") on
your MS Windows computer. 

Start with downloading [Yii](http://www.yiiframework.com/download/
"Download Yii") and deploy the framework in your webroot/vhost

Now you have to add the following PATH:s in Windows:
"`C:\wamp\bin\php\php5.2.8`" and "`C:\wamp\www\framework`".
The former path should lead where your <i>php.exe</i> resides, and
the latter where your <i>yiic.bat</i> resides. To do so, go to:
`start -> My computer(right click!) -> Advanced Tab -> Environment
Variables -> Click Path in System variables -> Edit`

After entering the paths, type `cmd` in your startmenus searchfield, and go to
the webroot.

`yiic webapp mywebsite`

Will generate a Yii skeleton for your web application inside the directory
"mywebsite" in your WAMP webroot folder.
One reason that you should stand in your WAMP webroot when giving the yiic
commands is that you don't have to specify where you want the web application

## Accessing yiic for the local web applicaton

After you have created your webapp you want to use the yiic command shell to
generate model classes and using the CRUD functionality.

For this you should go to "`C:\wamp\www\mywebsite\protected`".
The reason you should stand here is that you want to use the local
<i>yiic</i> command for the application. This is necessary if you
want to create models and CRUD using the database schema as a template. The yiic
command will use the configuration of the web application!

`yiic shell ..\index.php`

This command will start the local yiic shell that gives you access to the CRUD
commands and even the commands that you build into your webapp.

Don't forget to configure your [database
"Configure database settings") in `protected\config\console.php`.
Write new article
  • Written by: krillzip
  • Updated by: Yang He
  • Category: Tutorials
  • Yii Version: 1.1
  • Votes: +2
  • Viewed: 63,139 times
  • Created on: Feb 5, 2009
  • Last updated: Jun 29, 2012