Yii is an open source project released under the terms of the BSD License. This means that you can use Yii for free to develop either open-source or proprietary Web applications.

There are two ways to install Yii: by using Composer or by downloading an application template. We highly recommend you to use Composer.

If you do not have Composer installed yet, you may install it following the instructions on the Composer website.

Yii 2.0

Install via Composer (recommended)

The installation instructions described here are a short summary, you may want to check the Definitive Guide for more detailed instructions.

Choose one of the application templates to start installing Yii 2.0. An application template is a package that contains a skeleton Web application written in Yii which you can start building your application from. If you just start with Yii, we recommend the installation of the basic template.

To install the basic application template, run the following command:

php composer.phar create-project yiisoft/yii2-app-basic basic

The best way to get started with the basic application template is to follow the introduction in the definitive guide.

To install the advanced application template, run the following command:

php composer.phar create-project yiisoft/yii2-app-advanced advanced

When you have installed the advanced application template, you should check out its documentation to learn how to use it.

Install from an Archive File

Download one of the following archive files, and then extract it to Web-accessible folder:

Afterwards you may want to follow the introduction in the definitive guide to get started, or check out the documentation of the advanced application template to learn how to use it.

Upgrade from Older Versions

If you are upgrading from Yii 2.0.x with Composer, simply run the following commands in your project's root directory:

php composer.phar update yiisoft/yii2 yiisoft/yii2-composer bower-asset/jquery.inputmask

When upgrading Yii there might be changes that require adjustment in you application code, so you should always check the UPGRADE notes. These also contain more detailed instructions on how to upgrade Yii with composer.

If you installed Yii using an archive file, you can either follow the progress described above using Composer, or download a new release file and replace the contents of the vendor/ directory in your application with the files from the new archive file.

Upgrading from Yii 1.1 is not trivial and requires rewriting a great part of your application code. Please refer to the guide about upgrading from Yii 1.1 for more details.

Offline Documentation

The Definitive Guide to Yii 2.0 and the API Documentation are available for offline browsing. Below you will find the download packages including the HTML files of Guide and API Documentation as well as links to the PDF versions of the Guide in different languages.

 

Yii 1.1

Yii 1.1 is currently in maintenance mode.

Continued support and bug fixes for this version have been provided until December 31, 2016 .

Security fixes and PHP 7 compatibility until December 31, 2020 .

You may obtain the latest development version of the Yii 1.1 code from the Github repository using git:

git clone git@github.com:yiisoft/yii.git yii

or via SVN using:

svn checkout https://github.com/yiisoft/yii/trunk/ yii

The yiisoft/yii composer package is available as well.

Documentation

 

Archive

If you are looking for Yii 1.0 and other really old resources, you may find them at the museum.