9 Feb 2014

How to Install Yii Application in Wamp Server(windows-7/8)

This is my first tutorial regarding Yii so I am showing all necessary steps and how to install the framework in wamp server.Before starting your Yii application in windows server you need set your php engine location in environment variable.Installing Yii framework is not as easy as Codeigniter, which is basically just copy and pasting framework in WAMP root. Installing Yii is little bit tricky as compared to Codeigniter. In this tutorial I will try to make it easy by giving you step by step explanation. So lets start.

Before giving all the steps I assume you have installed your wamp server having the directory
"C:\wamp\" and also I am showing all the details by testing through my system.


First  Download the latest version of Yii Framework form http://www.yiiframework.com/download/


Unzip the tar file and rename if as Yii (as you like I have named as Yii)
Or  You can extract the file to C:\wamp\www\Yii


Next we need to add the copies PHP path to our system environment variable. For this go to “My Computer” ->Right click and select “Properties”

Now click on Advanced system settings

after clicking the link you will see a pop-up window, under “Advanced” tab at the bottom you will find “Environment Variables”.

Now click "Environment Variables" then it will open new pop-up window and then under “System variables” scroll and find “Path” like below image.

now select the “Path” variable and click “Edit” button that will pop-up a small window with variable name and variable value. like below image.

click on “Variable value ” and using arrow keys or end key scroll to the end of values line and press ” ; ” ( without double quotes) and then paste C:\wamp\bin\php\php5.4.3;C:\wamp\www\Yii\framework
The former path should lead where your php.exe resides, and the latter where your yiic.bat resides.

Click ok on all the pop-up windows. You are done with adding PHP path to system variables.


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

Note: Make sure there is a semicolon ; present before pasting the copied PHP path in system variable

Step 4: 

Now we need Yii framework setup and install it using command prompt

After entering the paths, type cmd in your start menu's search field or (windows button + R), 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.

Next we use command “yiic webapp C:\wamp\www\Yii\testapplication” and hit enter( where 
C:\wamp\www\Yii\testapplication is my path where I want to create my new yii project)

I want my new yii project to be named testapplication so command prompt will be like

type y and hit enter and My Yii framework will be installed.

Congratulation ,finally your Yii application is successfully created .

You can now go to your localhost and test your new project it will be up and running


Or You Can watch the video tutorial for installing and setting Php engine path:

                                     Best of luck .Have a Great Day.