当前位置:网站首页>OneinStack多版本PHP共存
OneinStack多版本PHP共存
2022-08-02 08:16:00 【nginx】
1、安装OneinStack选择lnmp模式,默认安装php5.4,安装步骤参考:
选项如下:
2、 安装php7
Install NginxDo not install Apache
Do not install Tomcat
Install MySQL-5.6
Install php-5.4
....
默认php5.4安装路径是/usr/local/php,如果再次安装会提示php已经安装,因此必须修改options.conf的php安装目录,将php7安装路径设置为/usr/local/php7,修改/root/oneinstack/options.conf:
service php-fpm stop #后面需要再安装php,需要停止phpmv /etc/init.d/php-fpm{,_bk} #后面需要再安装php会覆盖,备份启动脚本
再次执行./install.sh,选择Install php-7,其余均选择n
php_install_dir=/usr/local/php7
3、修改php配置文件
设置php5.4、php7开机自启动:
service php-fpm stop #停止php7启动脚本mv /etc/init.d/php-fpm /etc/init.d/php7-fpm #重命名php7启动脚本mv /etc/init.d/php-fpm_bk /etc/init.d/php-fpm #恢复php5.4启动脚本
:
Ubuntu/Debian:
chkconfig --add php7-fpmchkconfig --add php-fpm
chkconfig php7-fpm on
chkconfig php-fpm on
防止php5.4、php7监听sock冲突,修改php7的listen,更改配置文件/usr/local/php7/etc/php-fpm.conf:
update-rc.d php7-fpm defaultsupdate-rc.d php-fpm defaults
手工启动php5.4、php7:
listen = /dev/shm/php-cgi.sock #修改前listen = /dev/shm/php7-cgi.sock #修改后
如下图:
service php-fpm start #启动php5.4service php7-fpm start #启动php7

4、 修改nginx虚拟主机配置文件./vhost.sh绑定域名,默认是运行在php5.4,如需要将网站运行在php7下,需要修改/usr/local/nginx/conf/vhost/(改成自己绑定域名):
重新加载nginx,使配置生效:
fastcgi_pass unix:/dev/shm/php-cgi.sock; #修改前fastcgi_pass unix:/dev/shm/php7-cgi.sock; #修改后
service nginx reload
原文来自:
边栏推荐
- R语言plotly可视化:plotly可视化回归模型实际值和回归预测值的散点图分析回归模型的预测效能、一个好的模型大部分的散点在对角线附近(predicted vs actual)
- cas:139504-50-0 美登素DM1|Mertansine|
- A little bit of knowledge - why do not usually cook with copper pots
- Shell变成规范与变量
- Redis分布式锁
- 轴流式水轮机隐私政策
- 下一个排列
- Biotin-C6-amine|N-biotinyl-1,6-hexanediamine|CAS: 65953-56-2
- Business Intelligence Platform BI Business Intelligence Analysis Platform How to Choose the Right Business Intelligence Platform BI
- ip地址那点事(二)
猜你喜欢
随机推荐
图扑软件数字孪生油气管道站,搭建油气运输管控平台
按键控制流水灯(计时器)
Redisson的看门狗机制
JSP页面中page指令有哪些属性及方法可使用呢?
【论文阅读】Distilling the Knowledge in a Neural Network
十大免费cms建站系统介绍推荐
自定义table表格
PyCharm使用教程(详细版 - 图文结合)
Ansible 学习总结(11)—— task 并行执行之 forks 与 serial 参数详解
pnpm: Introduction
How Engineers Treat Open Source --- A veteran engineer's heartfelt words
Redisson报异常attempt to unlock lock, not locked by current thread by node id解决方案
R language plotly visualization: use the plotly visualization model to predict the true positive rate (True positive) TPR and false positive rate (False positive) FPR curve under different thresholds
AttributeError: module ‘clr‘ has no attribute ‘AddReference‘
EPSANet: An Efficient Pyramid Split Attention Block on Convolutional Neural Network
CASA模型、CENTURY模型应用与案例分析
Shell becomes canonical and variable
MySQL读写分离与主从延迟
JSP中page指令的import命令具有什么功能呢?
那些年我们踩过的 Flink 坑系列