how to install yii framework on windows 7


Start with downloading Yii and deploy the framework in your webroot/vhost (D:\xampp\htdocs\).

Open the Environment Variables window by going to: Start -> My Computer (right click!) -> Advanced Tab -> Environment Variables -> Click Path in System variables -> Edit.

In Windows 7, press the Win key and type “env”. You should see a control panel section with a shortcut to “Edit the system environment variables”. Select it and then click on “Environment Variables…”.

Click on the variable called PATH and click “Edit…”. Do not delete the paths already there! Separate each path with semicolons.

Now you have to add the following PATHs in Windows: “D:\xampp\bin\php\php5.2.8” and “D:\xampp\www\framework“. The former path should lead where your php.exe resides, and the latter where your yiic.bat resides.

After entering the paths, type cmd in your startmenus searchfield, and go to the webroot. You may have to restart the computer if this does not work for you so that Windows can register the new variables.

yiic webapp yii_framework

Will generate a Yii skeleton for your web application inside the directory “yii_framework” in your XAMPP webroot folder. One reason that you should stand in your XAMPP webroot when giving the yiic commands is that you don’t have to specify where you want the web application generated.

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 “D:\xampp\htdocs\yii_framework\protected“. The reason you should stand here is that you want to use the local yiic 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 settings in protected\config\console.php.

frame_0

frame_00

frame_01

frame_02