1、ubuntu自带的apt-get源支持的php版本为5.3.2,yii2.0需要5.4.0以上版本
有2种方法达到这个目的:
a.从私有源安装
apt-get install python-software-properties
add-apt-repository ppa:ondrej/php5
apt-get update
apt-get install php5
b.从源代码安装
wget http://cn2.php.net/distributions/php-5.6.6.tar.gz
tar xvf php-5.6.6.tar.gz
cd php-5.6.6
./configure --with-iconv=/usr/local/libiconv --with-mysql --enable-mbstring --with-openssl
make
make install
2、安装composer、安装composer asset插件以及创建yii2.0高级应用模板
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
composer global require "fxp/composer-asset-plugin:~1.0.3"
composer create-project yiisoft/yii2-app-advanced advanced 2.0.6