Creating new web app using yii

In this tutorial I will show you how you can create your very first web application using the yii php framework.

Yiic is the command we will be using to create the webapp.

First thing that you’ll need to do is to download the yii framework.

Then unzip it using a 7-zip, winrar, zip genius, pea zip or any other archive extracting software.

Its not necessary that you will copy the extracted folder to your web accessible folder.

But for this tutorial, just copy it there.

For those of you who are using xampp. Just copy it into your htdocs folder.

Those who use wamp, copy it into the www folder.

What we will be doing next is to add up environment variables.

To do that, just right click on My Computer->Properties->Advanced System Settings->Advanced Tab->Environment Variables

image

After that, focus on the system variables then scroll down until you find the first path that you will see. Highlight it and click on edit.

image

Now,  you need to live that window open for a while then search for the folder where you have installed php.

PHP will automatically be installed when you install either xampp or wamp.

For wamp:

-The default installation folder would be C:Wamp

then copy the  address below:

C:Wampbinphpphp5.3.0

Note: The php version might be different for you, so just navigate to that folder and copy the applicable php version for you

After editing copy the address to your environment variables window. Just be sure to place a semi-colon after the last path that has been added.

As an example, mine looks like this:

C:Program FilesCommon FilesMicrosoft SharedWindows Live;
C:Program Files (x86)Common FilesMicrosoft SharedWindows Live;
%SystemRoot%system32;
%SystemRoot%;
%SystemRoot%System32Wbem;
%SYSTEMROOT%System32WindowsPowerShellv1.0;
c:Program Files (x86)Microsoft SQL Server90Toolsbinn;
C:Program Files (x86)Javajdk1.6.0_18bin;
C:Program Files (x86)Javajdk1.6.0_18lib;
D:Programswampbinphpphp5.3.0;
C:Program FilesTortoiseSVNbin;C:devsfprojectlibvendorsymfonydatabin;
D:Programswampbinphpphp5.3.0;D:Programswampwwwyiframework;
C:Program Files (x86)GTK2-Runtimebin;C:Program Files (x86)AutodeskBackburner;
C:Program Files (x86)Windows LiveShared;
C:Program Files (x86)Microsoft SQL Server80ToolsBinn

Yup, that’s a bit of an overkill. If you’re wondering where did I get that one:

image

Finally, navigate to the directory where you copied the yii framework. Mine is in:

D:Programswampwwwyiframework

So I added that one to the environment variables as well. As you can see above

You can now fire up the command line. Create the directory where you will install the yii webapp. Then navigate to it

image

Now type in, yiic webapp [folderWhereYouWillInstallWebApp]

image

Type, y on your keyboard. Then bam! You will now see something like this when you navigate the directory in your browser:

image

5 thoughts on “Creating new web app using yii

  1. Thanks buddy you solved my big problem… I kept on trying to make my first program but was confused with the name of all directories used in different blogs … They always use rootfolder it made me bit confused ..
    It seems you are good in framework…so can i ask doubts which may occur in future?
    I am creating a website and my project manager told us to use framework.
    I m totally new to framework as i used to code php in dreamweaver.

Leave a comment