安装PHP yii2框架(PHP7.0+mysql+nginx+Ubuntu16.04)
2017-06-07 00:00
956 查看
步骤一:安装PHP7.0
sudoapt-getinstallphp
sudoapt-getinstallphp7.0-mbstring
步骤二:安装composer
curl-sShttp://packagist.cn/composer/installer|php
切换到全局安装文件夹
sudomvcomposer.phar/usr/local/bin/composer
步骤三:安装nginx
sudoapt-getnginx
步骤四:修改php.ini
修改:cgi.fix_pathinfo=0
步骤五:修改nginx配置文件
server{
listen80;
server_namecxj.test.com;
root/data/wwwroot;
indexindex.htmlindex.php;
location~\.php$
{
try_files$uri=404;
fastcgi_passunix:/run/php/php7.0-fpm.sock;
fastcgi_indexindex.php;
fastcgi_paramHTTPSon;
includefastcgi.conf;
}
location~.*\.(ico|gif|jpg|jpeg|png|bmp|swf|js|css)$
{
expires30d;
}
location^~/src{
denyall;
}
location~.*\.(log|sh)$
{
root/data/wwwroot/log;
denyall;
}
}
步骤六:安装yii2
1、安装ComposerAsset插件:
phpcomposer.pharglobalrequire"fxp/composer-asset-plugin:^1.2.0"
2、安装基本的应用程序模板,运行下面的命令:
composercreate-projectyiisoft/yii2-app-basicbasic2.0.9
安装高级的应用程序模板,运行下面的命令:
composercreate-projectyiisoft/yii2-app-advancedadvanced2.0.9
sudoapt-getinstallphp
sudoapt-getinstallphp7.0-mbstring
步骤二:安装composer
curl-sS
切换到全局安装文件夹
sudomvcomposer.phar/usr/local/bin/composer
步骤三:安装nginx
sudoapt-getnginx
步骤四:修改php.ini
修改:cgi.fix_pathinfo=0
步骤五:修改nginx配置文件
server{
listen80;
server_namecxj.test.com;
root/data/wwwroot;
indexindex.htmlindex.php;
location~\.php$
{
try_files$uri=404;
fastcgi_passunix:/run/php/php7.0-fpm.sock;
fastcgi_indexindex.php;
fastcgi_paramHTTPSon;
includefastcgi.conf;
}
location~.*\.(ico|gif|jpg|jpeg|png|bmp|swf|js|css)$
{
expires30d;
}
location^~/src{
denyall;
}
location~.*\.(log|sh)$
{
root/data/wwwroot/log;
denyall;
}
}
步骤六:安装yii2
1、安装ComposerAsset插件:
phpcomposer.pharglobalrequire"fxp/composer-asset-plugin:^1.2.0"
2、安装基本的应用程序模板,运行下面的命令:
composercreate-projectyiisoft/yii2-app-basicbasic2.0.9
安装高级的应用程序模板,运行下面的命令:
composercreate-projectyiisoft/yii2-app-advancedadvanced2.0.9
相关文章推荐
- 安装PHP yii2框架(PHP7.0+mysql+nginx+Ubuntu16.04)
- ubutnu16.04 安装nginx php7.0 mysql
- Ubuntu16.04 中PHP7.0 安装pdo_mysql 扩展
- 在 Ubuntu 16.04上安装 Nginx, MySQL, PHP (LEMP)
- Ubuntu 16.04 LTS 安装配置 Nginx 1.10.0 Php7.0-FPM
- Ubuntu16.04 中PHP7.0 安装pdo_mysql 扩展
- ubuntu上安装php7.0+nginx+mysql
- Ubuntu16.04 apt-get命令安装 Nginx、PHP 7、MySQL 5.7
- 在 Ubuntu 16.04上安装 Nginx, MySQL, PHP (LEMP)
- Ubuntu 16.04 lts 下安装mysql + php + nginx + phpmyadmin(图形化mysql管理工具)
- ubuntu16.04安装mysql+php+phpmyadmin(nginx已经安装)
- Ubuntu16.04 中PHP7.0 安装pdo_mysql 扩展
- Ubuntu16.04 中PHP7.0 安装pdo_mysql 扩展
- ubuntu 安装 nginx php7.0-fpm mysql-server php7.0-mysql
- Ubuntu+Nginx+Mysql+Php+Zend+eaccelerator安装配置文字版
- 基于ubuntu下nginx+php+mysql安装配置的具体操作步骤
- 基于ubuntu下nginx+php+mysql安装配置的具体操作步骤
- ubuntu下nginx+Mysql+php的安装和配置
- ubuntu/redhat/centOS下源码安装nginx+php+mysql
- Ubuntu安装Nginx+PHP+Memcache+Mysql指导手册