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
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.
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.
-The default installation folder would be C:Wamp
then copy the address below:
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:
Finally, navigate to the directory where you copied the yii framework. Mine is in:
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
Now type in, yiic webapp [folderWhereYouWillInstallWebApp]
Type, y on your keyboard. Then bam! You will now see something like this when you navigate the directory in your browser: