1.安装composer
curl -sS https://getcomposer.org/installer | php mv composer.phar /usr/local/bin/composer
2.把代码上传到git上
3. 安装php,mysql-server,nginx, phpmyadmin
还要修改nginx的配置sudo nano /etc/nginx/sites-available/default
location ~ \.php$ {
# include snippets/fastcgi-php.conf;
#
# # With php7.0-cgi alone:
#fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
# With php7.0-fpm:
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_na$
include fastcgi_params;
}
location /phpmyadmin {
alias /usr/share/phpmyadmin;
index index.php;
}
location /yiiblog {
index index.php;
}
4. 在yii项目根目录下执行composer install
5. 还要初始化下 ./init --env=Production --overwrite=y
http://www.codeblogbt.com/archives/49432