侯体宗的博客
  • 首页
  • Hyperf版
  • beego仿版
  • 人生(杂谈)
  • 技术
  • 关于我
  • 更多分类
    • 文件下载
    • 文字修仙
    • 群聊
    • 九宫格抽奖
    • 拼图
    • 消消乐
    • 相册

lnmp1.6正式版一键安装包php5+升级到php7+操作流程步骤及升级报错处理

php  /  管理员 发布于 2年前   1483

一台centos7.6的测试机之前装的时候随便装了5.6后面需要测试laravel所以要升级到7.3+

进入到你的lnmp1.6安装包的根目录

[root@www ~]# ll
total 3760
-rw-------. 1 root  root     1454 Aug 22  2019 anaconda-ks.cfg
drwxr-xr-x. 7 root  root      251 Jun 19  2019 lnmp1.6
-rw-r--r--. 1 root  root   160228 Aug 18  2019 lnmp1.6.tar.gz
-rw-r--r--. 1 root  root  2696785 Aug 28  2019 lnmp-install.log
-rw-r--r--. 1 mysql wheel   22710 Apr 25  2018 package.xml
-rw-r--r--  1 root  root   955864 Jul  8 10:53 upgrade_lnmp_php20200708104353.log
[root@www ~]# cd lnmp1.6
[root@www lnmp1.6]# ll
total 100
-rwxr-xr-x. 1 root root  9671 May 26  2019 addons.sh
-rw-r--r--. 1 root root 13722 Dec 31  2018 ChangeLog
drwxr-xr-x. 4 root root  4096 Apr  1  2019 conf
drwxr-xr-x. 2 root root  4096 Mar 20  2019 include
drwxr-xr-x. 2 root root   161 Mar 13  2019 init.d
-rwxr-xr-x. 1 root root  5393 Jun 19  2019 install.sh
-rw-r--r--. 1 root root   209 Jul  3  2016 License
-rwxr-xr-x. 1 root root   375 Jan  4  2019 lnmp.conf
-rwxr-xr-x. 1 root root  5193 Mar 21  2019 pureftpd.sh
-rw-r--r--. 1 root root  7131 Jun  4  2019 README
drwxr-xr-x. 5 root root  4096 Jul  8 10:46 src
drwxr-xr-x. 2 root root   247 Apr  1  2017 tools
-rwxr-xr-x. 1 root root  6447 Dec  7  2018 uninstall.sh
-rwxr-xr-x. 1 root root 14178 Feb 28  2019 upgrade1.x-1.6.sh
-rwxr-xr-x. 1 root root  2777 Dec  7  2018 upgrade.sh

执行:   ./upgrade.sh php (会显示要你输入升级的php版本号,如7.3.11回车,再次回车确认即可开始升级)

然后就等结束提示升级成功完成就ok了 .......但是 

既然是升级就有可能会失败 

比如我这就遇到了一种,开始升级后直接很长时间停在这里 看

Warning! a PEAR user config file already exists from a previous PEAR installation at '/root/.pearrc'. You may probably want to remove it.
Wrote PEAR system config file at: /usr/local/php/etc/pear.conf
You may want to add: /usr/local/php/lib/php to your php.ini include_path
/root/lnmp1.6/src/php-7.3.11/build/shtool install -c ext/phar/phar.phar /usr/local/php/bin
ln -s -f phar.phar /usr/local/php/bin/phar
Installing PDO headers:           /usr/local/php/include/php/ext/pdo/
Copy new php configure file...
Modify php.ini......
config-set succeeded
config-set succeeded
All settings correct for using Composer
Downloading...

直接ctrl+z停止它

php-v看一下版本

[root@www ~]# php -v
PHP 7.3.11 (cli) (built: Jul  8 2020 10:51:32) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.11, Copyright (c) 1998-2018 Zend Technologies

这样就成功了 好那就重启服务lnmp restart

[root@www ~]# lnmp restart
+-------------------------------------------+
|    Manager for LNMP, Written by Licess    |
+-------------------------------------------+
|              https://lnmp.org             |
+-------------------------------------------+
Stoping LNMP...
Stoping nginx... nginx is not running.
ERROR! MySQL server PID file could not be found!
/usr/bin/lnmp: line 41: /etc/init.d/php-fpm: No such file or directory
Starting LNMP...
Starting nginx...  done
Starting MySQL.. SUCCESS!
/usr/bin/lnmp: line 27: /etc/init.d/php-fpm: No such file or directory

有问题 提示:/etc/init.d/php-fpm 文件不存在 那就创建它咯

[root@www ~]# vi /etc/init.d/php-fpm
#我到另外一台php版本是7.3.11的服务器上复制过来配置信息

#! /bin/sh

### BEGIN INIT INFO
# Provides:          php-fpm
# Required-Start:    $remote_fs $network
# Required-Stop:     $remote_fs $network
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: starts php-fpm
# Description:       starts the PHP FastCGI Process Manager daemon
### END INIT INFO

prefix=/usr/local/php
exec_prefix=${prefix}

php_fpm_BIN=${exec_prefix}/sbin/php-fpm
php_fpm_CONF=${prefix}/etc/php-fpm.conf
php_fpm_PID=${prefix}/var/run/php-fpm.pid


php_opts="--fpm-config $php_fpm_CONF --pid $php_fpm_PID"


wait_for_pid () {
try=0

while test $try -lt 35 ; do

case "$1" in
'created')
if [ -f "$2" ] ; then
try=''
break
fi
;;

'removed')
if [ ! -f "$2" ] ; then
try=''
break
fi
;;
esac

echo -n .
try=`expr $try + 1`
sleep 1

done

}

case "$1" in
start)
echo -n "Starting php-fpm "

$php_fpm_BIN --daemonize $php_opts

if [ "$?" != 0 ] ; then
echo " failed"
exit 1
fi

wait_for_pid created $php_fpm_PID

if [ -n "$try" ] ; then
echo " failed"
exit 1
else
echo " done"
fi
;;

stop)
echo -n "Gracefully shutting down php-fpm "

if [ ! -r $php_fpm_PID ] ; then
echo "warning, no pid file found - php-fpm is not running ?"
exit 1
fi

kill -QUIT `cat $php_fpm_PID`

wait_for_pid removed $php_fpm_PID

if [ -n "$try" ] ; then
echo " failed. Use force-quit"
exit 1
else
echo " done"
fi
;;

status)
if [ ! -r $php_fpm_PID ] ; then
echo "php-fpm is stopped"
exit 0
fi

PID=`cat $php_fpm_PID`
if ps -p $PID | grep -q $PID; then
echo "php-fpm (pid $PID) is running..."
else
echo "php-fpm dead but pid file exists"
fi
;;

force-quit)
echo -n "Terminating php-fpm "

if [ ! -r $php_fpm_PID ] ; then
echo "warning, no pid file found - php-fpm is not running ?"
exit 1
fi

kill -TERM `cat $php_fpm_PID`

wait_for_pid removed $php_fpm_PID

if [ -n "$try" ] ; then
echo " failed"
exit 1
else
echo " done"
fi
;;

restart)
$0 stop
$0 start
;;

reload)

echo -n "Reload service php-fpm "

if [ ! -r $php_fpm_PID ] ; then
echo "warning, no pid file found - php-fpm is not running ?"
exit 1
fi

kill -USR2 `cat $php_fpm_PID`

echo " done"
;;

configtest)
$php_fpm_BIN -t
;;

*)
echo "Usage: $0 {start|stop|force-quit|restart|reload|status|configtest}"
exit 1
;;

esac

继续重启服务: lnmp restart

[root@www ~]# lnmp restart
+-------------------------------------------+
|    Manager for LNMP, Written by Licess    |
+-------------------------------------------+
|              https://lnmp.org             |
+-------------------------------------------+
Stoping LNMP...
Stoping nginx...  done
Shutting down MySQL. SUCCESS! 
/usr/bin/lnmp: line 41: /etc/init.d/php-fpm: Permission denied
Starting LNMP...
Starting nginx...  done
Starting MySQL.. SUCCESS! 
/usr/bin/lnmp: line 27: /etc/init.d/php-fpm: Permission denied

又有问题 无权限 直接给权限755

chmod 755 /etc/init.d/php-fpm

在一次重启服务:lnmp restart

[root@www ~]# lnmp restart
+-------------------------------------------+
|    Manager for LNMP, Written by Licess    |
+-------------------------------------------+
|              https://lnmp.org             |
+-------------------------------------------+
Stoping LNMP...
Stoping nginx...  done
Shutting down MySQL. SUCCESS!
Gracefully shutting down php-fpm warning, no pid file found - php-fpm is not running ?
Starting LNMP...
Starting nginx...  done
Starting MySQL.. SUCCESS!
Starting php-fpm [08-Jul-2020 11:17:03] ERROR: failed to open configuration file '/usr/local/php/etc/php-fpm.conf': No such file or directory (2)
[08-Jul-2020 11:17:03] ERROR: failed to load configuration file '/usr/local/php/etc/php-fpm.conf'
[08-Jul-2020 11:17:03] ERROR: FPM initialization failed
failed

又有问题 提示/usr/local/php/etc/php-fpm.conf 文件不存在 继续创建它

[root@www ~]# vi /usr/local/php/etc/php-fpm.conf
#我到另外一台php版本是7.3.11的服务器上复制过来配置信息

[global]
pid = /usr/local/php/var/run/php-fpm.pid
error_log = /usr/local/php/var/log/php-fpm.log
log_level = notice

[www]
listen = /tmp/php-cgi.sock
listen.backlog = -1
listen.allowed_clients = 127.0.0.1
listen.owner = www
listen.group = www
listen.mode = 0666
user = www
group = www
pm = dynamic
pm.max_children = 120
pm.start_servers = 30
pm.min_spare_servers = 30
pm.max_spare_servers = 120
pm.max_requests = 1024
pm.process_idle_timeout = 10s
request_terminate_timeout = 300
request_slowlog_timeout = 0
slowlog = var/log/slow.log

继续重启服务:lnmp restart

[root@www ~]# lnmp restart
+-------------------------------------------+
|    Manager for LNMP, Written by Licess    |
+-------------------------------------------+
|              https://lnmp.org             |
+-------------------------------------------+
Stoping LNMP...
Stoping nginx...  done
Shutting down MySQL. SUCCESS!
Gracefully shutting down php-fpm warning, no pid file found - php-fpm is not running ?
Starting LNMP...
Starting nginx...  done
Starting MySQL.. SUCCESS!
Starting php-fpm  done

php没运行 忽略它 在重启服务一次:lnmp restart

[root@www ~]# lnmp restart
+-------------------------------------------+
|    Manager for LNMP, Written by Licess    |
+-------------------------------------------+
|              https://lnmp.org             |
+-------------------------------------------+
Stoping LNMP...
Stoping nginx...  done
Shutting down MySQL. SUCCESS!
Gracefully shutting down php-fpm . done
Starting LNMP...
Starting nginx...  done
Starting MySQL.. SUCCESS!
Starting php-fpm  done
[root@www ~]#

ok了  希望对你有帮助


  • 上一条:
    阿里云服务器centos7+mysql数据库主从复制功能流程步骤
    下一条:
    laravel7+安装laravel-admin操作流畅步骤及mysql5.5版本报错处理
  • 昵称:

    邮箱:

    0条评论 (评论内容有缓存机制,请悉知!)
    最新最热
    • 分类目录
    • 人生(杂谈)
    • 技术
    • linux
    • Java
    • php
    • 框架(架构)
    • 前端
    • ThinkPHP
    • 数据库
    • 微信(小程序)
    • Laravel
    • Redis
    • Docker
    • Go
    • swoole
    • Windows
    • Python
    • 苹果(mac/ios)
    • 相关文章
    • windows系统中安装FFMpeg及在phpstudy环境php7.3 + php-ffmpeg扩展的使用流程步骤(0个评论)
    • 在php语言中对数组参数实现签名算法及加解密数组功能流程步骤(0个评论)
    • 在PHP语言中实现手机加密解密算法代码示例(0个评论)
    • 在PHP 8.3版本中json_validate跟json_decode函数对比浅析(0个评论)
    • 在PHP语言中class类自动加载相关文件浅析(0个评论)
    • 近期文章
    • 如何优雅处理async await错误推荐:await-to-js库(0个评论)
    • lodash工具库(0个评论)
    • 在Laravel项目中使用中间件方式统计用户在线时长功能代码示例(0个评论)
    • 在Laravel中构建业务流程模型(0个评论)
    • windows系统中安装FFMpeg及在phpstudy环境php7.3 + php-ffmpeg扩展的使用流程步骤(0个评论)
    • 在go语言中对浮点的数组、切片(slice)进行正向排序和反向排序(0个评论)
    • 在go语言中对整数数组、切片(slice)进行排序和反向排序(0个评论)
    • 在go语言中对字符串数组、切片(slice)进行排序和反向排序(0个评论)
    • 最新国内免注册ChatGPT体验站_ChatGPT镜像站访问链接地址2023/3/28持续更新(0个评论)
    • 在Laravel项目中的实现无密码认证之:发送邮箱链接授权(0个评论)
    • 近期评论
    • 博主 在

      2023年国务院办公厅春节放假通知:1月21日起休7天中评论 @ xiaoB 你只管努力,剩下的叫给天意;天若有情天亦老,..
    • xiaoB 在

      2023年国务院办公厅春节放假通知:1月21日起休7天中评论 会不会春节放假后又阳一次?..
    • BUG4 在

      你翻墙过吗?国内使用vpn翻墙可能会被网警抓,你需了解的事中评论 不是吧?..
    • 博主 在

      go语言+beego框架中获取get,post请求的所有参数中评论 @ t1  直接在router.go文件中配就ok..
    • Jade 在

      如何在MySQL查询中获得当月记录中评论 Dear zongscan.com team, We can skyroc..
    • 2016-10
    • 2016-11
    • 2017-06
    • 2017-07
    • 2017-08
    • 2017-09
    • 2017-11
    • 2017-12
    • 2018-01
    • 2018-02
    • 2018-03
    • 2020-03
    • 2020-04
    • 2020-05
    • 2020-06
    • 2020-07
    • 2020-09
    • 2021-02
    • 2021-03
    • 2021-04
    • 2021-05
    • 2021-06
    • 2021-07
    • 2021-08
    • 2021-09
    • 2021-10
    • 2021-11
    • 2021-12
    • 2022-01
    • 2022-02
    • 2022-05
    • 2022-06
    • 2022-07
    • 2022-08
    • 2022-09
    • 2022-10
    • 2022-11
    • 2022-12
    • 2023-01
    • 2023-02
    • 2023-03
    Top

    Copyright·© 2019 侯体宗版权所有· 粤ICP备20027696号 PHP交流群

    侯体宗的博客