VPS侦探论坛

 找回密码
 注册
查看: 4384|回复: 2

【建议】LNMP 1.4多版本PHP并存

[复制链接]
发表于 2017-4-4 15:10:30 | 显示全部楼层 |阅读模式

1、lnmp restart 这些仅支持重启默认版本的php,是否考虑重启其他版本 php-fpm
  1. lnmp_start()
  2. {
  3.     echo "Starting LNMP..."
  4.     /etc/init.d/nginx start
  5.     /etc/init.d/mysql start
  6.     #/etc/init.d/php-fpm start
  7.     for file in /etc/init.d/php-fpm*
  8.     do
  9.         if test -f $file
  10.         then
  11.             $file start
  12.         fi
  13.     done
  14. }

  15. lnmp_stop()
  16. {
  17.     echo "Stoping LNMP..."
  18.     /etc/init.d/nginx stop
  19.     /etc/init.d/mysql stop
  20.     #/etc/init.d/php-fpm stop
  21.     for file in /etc/init.d/php-fpm*
  22.     do
  23.         if test -f $file
  24.         then
  25.             $file stop
  26.         fi
  27.     done
  28. }

  29. lnmp_reload()
  30. {
  31.     echo "Reload LNMP..."
  32.     /etc/init.d/nginx reload
  33.     /etc/init.d/mysql reload
  34.     #/etc/init.d/php-fpm reload
  35.     for file in /etc/init.d/php-fpm*
  36.     do
  37.         if test -f $file
  38.         then
  39.             $file reload
  40.         fi
  41.     done
  42. }
复制代码



2、扩展组件安装是否也加入兼容多版本php(安装前加一个步骤,选择php版本)

[ 本帖最后由 pppscn 于 2017-4-4 21:20 编辑 ]
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2017-4-11 11:53:30 | 显示全部楼层


上面的有bug,php-fpm有可能存在备份文件
  1. lnmp_start()
  2. {
  3.     echo "Starting LNMP..."
  4.     /etc/init.d/nginx start
  5.     /etc/init.d/mysql start
  6.     /etc/init.d/php-fpm start
  7.     for file in /etc/init.d/php-fpm[0-9].[0-9]
  8.     do
  9.         if test -f $file
  10.         then
  11.             $file start
  12.         fi
  13.     done
  14. }

  15. lnmp_stop()
  16. {
  17.     echo "Stoping LNMP..."
  18.     /etc/init.d/nginx stop
  19.     /etc/init.d/mysql stop
  20.     /etc/init.d/php-fpm stop
  21.     for file in /etc/init.d/php-fpm[0-9].[0-9]
  22.     do
  23.         if test -f $file
  24.         then
  25.             $file stop
  26.         fi
  27.     done
  28. }

  29. lnmp_reload()
  30. {
  31.     echo "Reload LNMP..."
  32.     /etc/init.d/nginx reload
  33.     /etc/init.d/mysql reload
  34.     /etc/init.d/php-fpm reload
  35.     for file in /etc/init.d/php-fpm[0-9].[0-9]
  36.     do
  37.         if test -f $file
  38.         then
  39.             $file stop
  40.         fi
  41.     done
  42. }
复制代码

[ 本帖最后由 pppscn 于 2017-4-11 22:57 编辑 ]
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2017-4-11 13:51:23 | 显示全部楼层

第二点 已经在 【2017年4月10日13:58 GMT+8】 发布的包里面更新了
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-27 09:30 , Processed in 0.025714 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表