centos 6 安装 php 7.1

发布时间: 2019-03-18 12:50:58 作者: 大象笔记

查看 centos 系统版本号

cat /etc/redhat-release
CentOS release 6.9 (Final)

安装 php 7.1

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
yum install mod_php71w php71w-opcache
yum install php71w-cli php71w-mysql php71w-bcmath php71w-gd php71w-mcrypt php71w-mbstring php71w-odbc php71w-xml

安装完成之后确认 php 版本号

php -v
PHP 7.1.26 (cli) (built: Jan 12 2019 10:21:49) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.1.26, Copyright (c) 1999-2018, by Zend Technologies

安装 fpm

安装完之后,发现没有 php-fpm 服务

service php-fpm start
php-fpm: unrecognized service

使用 chkconfig 查看确实没有 fpm 服务

chkconfig --list

安装 fpm

yum install php71w-fpm

确认服务已安装

chkconfig --list
> php-fpm         0:off   1:off   2:off   3:off   4:off   5:off   6:off

启动 fpm 服务

service php-fpm start
Starting php-fpm:                                          [  OK  ]

参考

我是一名山东烟台的开发者,联系作者