Ubuntu nginx部署yii2

前端之家收集整理的这篇文章主要介绍了Ubuntu nginx部署yii2前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

1.安装composer

curl -sS https://getcomposer.org/installer | PHP
mv composer.phar /usr/local/bin/composer

2.把代码上传到git上

3. 安装PHPMysqL-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

猜你在找的Ubuntu相关文章