An Introduction to PHP YII Framework For The Beginners

Hello guys ! PHP is a very famous and secure web programming language all over the world. This language has become very much popular among world’s web programmer for it’s various outstanding features. Frameworks are one of them. Lot of PHP frameworks have been developed and as it is a continuous process so we can hope that we will get more php frameworks in the new future. So among all of these frameworks, it becomes very much confusing for the new php programmers to choose one for them. As a beginner I also faced this problem of choosing the right one for me. After spending several hours I found one php framework suitable for me for this present time. That is yii framework. I know that there are lot of new php programmers who can not choose or does not want to choose a right framework for themselves by themselves. They go for the suggestion to their senior brother or immediate boos who uses only Codeigniter and suggest the new programmer to learn Codeigniter also. But if we just think deeply for one minute before finalizing a framework to use we can very easily find a good option, that is yii. I will not say that to learn Codeigniter is a problem, but I want to say that by giving the same effort on yii you can build a very strong bridge in between Codigniter(entry label framework) and ZF, Symfony (advanced label framework). I mean among 5 numbers yii 3 !!! .

What is YII?

YII means – Yes It Is. You can use yii framework for all scale of web programs, from medium to large scale. Yii was introduced in PHP in 2008 by Qiang Xue. And from then it has been continuously developed by the community. It is an open source framework. Main features of yii are 1. Fast 2. Secure 3. Professional. I think we all php programmers need these three things of speed, security and professionalism.  Yii also very much easy to install/configure and maintain. It is well documented and has very helpful community to help. So new users may not think himself helpless. There are lot video tutorials on youtube, many tutorial web sites for this framework. There also many books on this framework. You can buy books from Nilkhet, Dhaka. “The Definitive Guide to Yii 1.1” is a good book written by Qinag Xue himself is very much popular among the yii developers. You can buy this book from Dhaka.

Anyway, before closing this article I will tell you how to install yii very easily. No beginner should go to try install cakephp or zend framework before learning codeigniter or yii or any other easy framework. This is totally my personal point of view. Ok guys lets start to install yii.

  1. Go to http://www.yiiframework.com/
    YII Website
  2. You will see Download yii option just beside Take The Tour option. Current version is 1.1.14
  3. Download and extract it in your directory.
  4. If you download the zip file out side of your web directory then copy it to your web directory. If you use wampp then it will www and if it is xampp it will be htdocs. Rename the extracted yii folder to yii or any other name you like.
  5. In you yii folder you will find 4 folders named- demos, framework, projects and requirements. Out of which framework and requirements are most important.PHP YII Folder Structure

6. You need to add your php path directory and yii->framework directory like – my computer>properties>advanced system settings>environment variables>path> edit. Please do not forget to add ; (semicolon) after your php path yii->framework path directory. 
PHP YII Path Directory7. Now you have see whether your computer system meets the requirements of yii. This is not anything difficult. Just go to your web browser and type localhost/yii/requirements and enter.

8. If everything is ok you will see most of the requirements are passed. So your system is fit to run yii.
YII Requirements Checker8. Now run CMD

9. Enter to your web directory. It will be like C:\xampp\htdocs>

RUN PHP YII in Command Format10. Now type yiic webapp testyii . It will now look like C:\xampp\htdocs> yiic webapp testyii  . Here testyii is just your website or project name. You can give any name instead of testyii. It will ask you whether to create the web application or not. Write Yes and press enter. You will see a message saying – your application has been created successfully under C:\\xampp\htdocs\testyii
PHP-YII-Creation

11. If you go to your htdocs/www folder you will see that one folder has been crated with the name testyii.
PHP YII Complete Installation

12. Finally go to your web browser and just type localhost/testyii  , you will see the welcome to my web application.
YII Final Output

Is it so tough ?  Have fun.

Thanks.

 

Hi I am Mukul Rahman. My love to PHP and its frameworks has brought me to this stage. I love other programming languages as well. I have a dream to do something big by using PHP. I am trying my best to fulfill my dream.
Print Friendly
3 comments on “An Introduction to PHP YII Framework For The Beginners
  1. Mukul, valo likhechis. Programming er proti tor agroho dekhe valoi laglo. Chaliye ja. Bortoman world a ekjon programmar onek demanded.
    Parle JAVA tao ektu dekhe nis.
    Sumon USA

  2. Dear,
    Masud alam sir,
    apnake cakephp framework er tutorial er upor article likhar jonno
    onurod korsi.

    Regards,
    Your student(Tanvir.)

  3. # STEP 1 #
    Unzip the Yii Framework File at Location “D:\WORKSTATION\XAMPP\htdocs\Yii” (suppose this is your Location)

    # STEP 2 #
    Go to: My Computer > Properties > Advanced System Settings > Advanced Tab > Environment Variables…
    Add Path as: Path = ” path ” and Value = ” ;D:\WORKSTATION\XAMPP\php;D:\WORKSTATION\XAMPP\htdocs\Yii\framework; ”

    # STEP 3 #
    Open the file: D:\WORKSTATION\XAMPP\htdocs\Yii\framework\yiic.bat with “NotePad++”
    Edit the line: FROM if “%PHP_COMMAND%” == “” set PHP_COMMAND=php.exe TO if “%PHP_COMMAND%” == “” set PHP_COMMAND=D:\WORKSTATION\XAMPP\php\php.exe

    # STEP 4 #
    Go to RUN, type CMD and open Command Prompt
    Put the Command ” C:\Users\MUSLIM>D:\WORKSTATION\XAMPP\htdocs\Yii\framework\yiic.bat webapp Yii ”
    Then Press “Y” and Press ENTER BUTTON

    Your Yii Framework will be installed at : C:\Users\NIRJHOR\Yii

Leave a Reply

Your email address will not be published. Required fields are marked *