首页 技术 正文
技术 2022年11月15日
0 收藏 580 点赞 2,449 浏览 715 个字

一 安装7.1

1. 安装PHP7.1

brew install php@7.1

2. 修改配置 php-fpm.conf,一般在/usr/local/etc/php下(如果php-fpm.conf中不存在,则查找php-fpm.d目录)

vim php-fpm.conflisten = 127.0.0.1:9000

3. 启动PHP7.1

brew services start php@7.1

4. 这时php-fpm会监听9000端口,修改nginx的配置文件改为端口为9000(一般在/usr/local/etc/nginx/下面)

vim nginx.conffastcgi_pass   127.0.0.1:9000

5. 启动nginx服务

#启动 brew services start nginx#重启 brew services restart nginx

6. 查看当前版本

php -v

二 安装并切换7.2

1. 清除PHP7.1的软链

brew unlink php@7.1

2. 安装PHP7.2

brew install php@7.2

3. 添加PHP7.2的软链

brew link php@7.2

4. 修改配置 php-fpm.conf

vim php-fpm.conflisten = 127.0.0.1:9001

5. 启动PHP7.2

brew services start php@7.2

6. 修改nginx配置

vim nginx.conffastcgi_pass   127.0.0.1:9001

7. 重启nginx服务

brew services restart nginx

8. 查看当前版本

php -v

9.修改环境变量

vi ~/.bash_profile

10.重新刷新环境变量

source ~/.bash_profile

以上就是这次的全部内容 !

上一篇: chapter2
相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,086
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,561
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,411
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,184
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,820
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,904