Introduction

Yii

Yii is a high-performance PHP framework suitable for developing Web 2.0 applications.
Yii ships with a rich set of features, including MVC, DAO/ActiveRecord, I18N/L10N, caching, authentication and role-based access control, scaffolding, testing, and more, which can significantly shorten development time.

Creation

Prerequisites

  • PHP runtime environment
  • Composer environment
    • Mac OS X

      1
      brew install composer
    • Ubuntu

      1
      2
      3
      4
      5
      6
      7
      8
      # Download
      curl -sS https://getcomposer.org/installer | php -d detect_unicode=Off
      # Make it global
      mv composer.phar /usr/local/bin/composer
      # Permissions
      chmod a+x /usr/local/bin/composer
      # Update
      composer self-update

Installation

  1. Install via Composer

    Install the composer-asset-plugin.
    1
    2
    3
    4
    # Switch to the China mirror (http://pkg.phpcomposer.com/)
    composer config -g repo.packagist composer https://packagist.phpcomposer.com

    composer global require "fxp/composer-asset-plugin:^1.2.0"
    Install the basic edition.
    1
    composer create-project yiisoft/yii2-app-basic xxx
    Install the advanced edition.
    1
    composer create-project yiisoft/yii2-app-advanced xxx
  2. Download and install

    Basic edition
    Advanced edition

Tips

1
The zip extension and unzip command are both missing, skipping.

Solution

1
apt-get install php7.0-zip

1
2
codeception/base 2.2.3 requires phpunit/phpunit >4.8.20 <5.5 -> satisfiable by phpunit/phpunit
phpunit/phpunit 5.6.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.

Solution

1
apt-get install php7.0-xml