博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Ubuntu 安装yii2 advanced版 遇到的坑
阅读量:7198 次
发布时间:2019-06-29

本文共 3064 字,大约阅读时间需要 10 分钟。

1.安装 Composer

通过 Composer 安装

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

解决方案

sudo vim /etc/php/7.2/cli/php.ini zlib.output_compression = ON

安装成功

2.安装yii2 高级版

安装yii2

composer create-project --prefer-dist yiisoft/yii2-app-advanced yii-application

报错:

更换源:

composer config repo.packagist composer https://packagist.phpcomposer.com

报错:

加参数-g global

composer config -g  repo.packagist composer https://packagist.phpcomposer.com

再次安装yii2

composer create-project --prefer-dist yiisoft/yii2-app-advanced yii-application

更改网络连接方式,桥接方式

安装php-mbstring

sudo apt-get install php-mbstring

报网络连接超时

在浏览器打开安装包地址

不能访问,
发现另外一个复制的虚拟机也打开了,怀疑是IP地址冲突,关掉另外一台虚拟机后,可以打开这个地址


再次安装,报错:

composer create-project --prefer-dist yiisoft/yii2-app-advanced yii-application

执行:sudo apt-get install phpunitsudo apt-get install php7.2-xml

再次安装,安装成功

composer create-project --prefer-dist yiisoft/yii2-app-advanced yii-application

3.配置nginx

sudo vim /etc/nginx/sites-available/default
server {        charset utf-8;        client_max_body_size 128M; listen 80; ## listen for ipv4 #listen [::]:80 default_server ipv6only=on; ## listen for ipv6 server_name frontend.test; root /home/jay/yii-application/frontend/web/; index index.php; access_log /home/jay/yii-application/log/frontend-access.log; error_log /home/jay/yii-application/log/frontend-error.log; location / { # Redirect everything that isn't a real file to index.php try_files $uri $uri/ /index.php$is_args$args; } # uncomment to avoid processing of calls to non-existing static files by Yii #location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ { # try_files $uri =404; #} #error_page 404 /404.html; # deny accessing php files for the /assets directory location ~ ^/assets/.*\.php$ { deny all; } location ~ \.php$ { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_pass 127.0.0.1:9000; #fastcgi_pass unix:/var/run/php5-fpm.sock; try_files $uri =404; } location ~* /\. { deny all; } } server { charset utf-8; client_max_body_size 128M; listen 80; ## listen for ipv4 #listen [::]:80 default_server ipv6only=on; ## listen for ipv6 server_name backend.test; root /home/jay/yii-application/backend/web/; index index.php; access_log /home/jay/yii-application/log/backend-access.log; error_log /home/jay/yii-application/log/backend-error.log; location / { # Redirect everything that isn't a real file to index.php try_files $uri $uri/ /index.php$is_args$args; } # uncomment to avoid processing of calls to non-existing static files by Yii #location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ { # try_files $uri =404; #} #error_page 404 /404.html; # deny accessing php files for the /assets directory location ~ ^/assets/.*\.php$ { deny all; } location ~ \.php$ { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_pass 127.0.0.1:9000; #fastcgi_pass unix:/var/run/php5-fpm.sock; try_files $uri =404; } location ~* /\. { deny all;

转载于:https://www.cnblogs.com/jackson0714/p/install_yii2.html

你可能感兴趣的文章
一个IT经理眼中的RTX、Simba2013与Lync
查看>>
mysql数据库批量插入数据shell脚本实现
查看>>
Virtual Machine Manager 2008 2008 R2系列之安装部署
查看>>
例解三层交换原理
查看>>
【灵性觉醒】解忧杂货店感悟
查看>>
"log_bin.index not found" 启动报错解决
查看>>
SFB 项目经验-36-分配公网证书 For SFB 2015-前端服务器(图解)
查看>>
SFB 项目经验-52-Outlook-2010/2013-连接Exchange 2016需要密码!
查看>>
白盒测试不是测试,更不高级
查看>>
CentOS 6使用openssl搭建根CA
查看>>
【Android】Handler详解
查看>>
JAVA程序猿怎么才干高速查找到学习资料?
查看>>
Generate Parentheses leetcode java
查看>>
轻量级开源嵌入式关系数据库sqlite基本使用及接口初识
查看>>
Hibernate Criterion
查看>>
自定义定时组件
查看>>
当开发者产生一个伟大的想法之后应该做的10件事
查看>>
高仿微信5.2.1主界面架构 包含消息通知
查看>>
Struts2
查看>>
spftlayer 安装及简单使用
查看>>