Learning Yii Framework – How to Install ?

yii php framework
Learning the Yii framework for Beginners : Introduction

What’s Yii Framework? Yii is a component-based application development framework written in PHP. It is open source and comes with rich features that can helps you to easily building large-scale web applications. Yii framework provides Clean code and DRY design and support the creation of applications that quickly using Code Generator, so you can speed up the work process developers to create web applications and ensure the final product is extremely efficient, extensible, and easy in maintenance. Currently Yii Framework is one of the most popular PHP frameworks.

Rich Features of Yii Framework

Here are a some features of yii framework

  • Model-View-Controller (MVC) design pattern and request handle workflow
  • Automatic code generation
  • Model – working with database Database (C Active Record), Access Objects (DAO), Query Builder, DB Migration
  • Support multi database system (MySQL, SQLite,…)
  • Gii Generator : CRUD, MODEL, Form, Module,…
  • Form – Handle user input data – Rules and validators
  • Flexible OOP (Object Oriented Programming)
  • AJAX-enabled widgets
  • Skinning and theming
  • Asset Manager
  • Error Handler & Log Management
  • Support multi-caching mechanism
  • Web services
  • Unit and functionality testing
  • URL manager
  • Session & Cookie Management
  • Extension library
  • Application Security (CSRF, Cookie vlidation,…)
  • User Authentication with RBAC
  • Detailed documentation
  • check more at http://www.yiiframework.com/features/

Yii Framework has a very complete documentation, so you can follow this link http://www.yiiframework.com/doc to find out more about yii.

Yii framework Tutorial – How to Install ?

Prior to installing Yii, you must configure your application development environment as a web server capable of supporting PHP 5.1.0 or higher. Yii has been thoroughly tested with Apache HTTP server on Linux and Windows operating systems. It may also run on other web servers and platforms, provided PHP 5 is supported.

Let’s get started. First of all, download the application of Yii on the official website http://www.yiiframework.com/download/, currently Yii 1.1 is the latest stable version. Extract the downloaded and store them in to local folder of our web server (in this case I’m using LAMP on linux so my server local folder located at /var/www/). don’t forget to rename the folder name of our application into “yii” to facilitate our learning process.

After installing Yii, you may want to verify that your server satisfies Yii’s requirements. You can do so by accessing the requirement checker script via the following URL in a Web browser:


To create your first Yii application, open up your terminal, and navigate to a place in your filesystem where you will want to create your application’s folder structure. go a head into the yii folder by typing:

>> cd /var/www/yii/framework 

after that, create new first app folder by typing this command

>> yiic webapp /var/www/learn-yii

if successfully, there will be showing the question that asking us to make new application in the root folder /var/www/learn-yii. please answer yes and type enter. make sure your php executable, already setting. for those of you who don’t succeed is because the path to PHP.exe not been directed, for windows setting, please click start -> computer -> right click -> select properties -> select advanced system settings -> select environment variables -> select "PATH" and edit the last line then add in C:\xampp\php; (if you’re using XAMPP).

create new application with yiic

If your new application has been created successfully. next open up your browser and navigate to http://localhost/learn-yii/. Here you will be presented with a My Web Application home page along with the friendly greeting Welcome to My Web Application, followed by some helpful information on the steps to be taken next. The next screenshot shows this example home page:

Yii Homepage My Web Application

Perfect, your first yii application has been created successfully. In the next tutorial, i’ll guide you how to generate code using yicc shell.