centos7安装php7

系统:centos7

参考来源:https://www.tecmint.com/install-php-7-in-centos-7/

首先安装需要的源:

# yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
# yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm  

然后安装yum工具:

# yum install yum-utils

然后选择安装php那个版本,以下运行一个即可:

php7.0

# yum-config-manager --enable remi-php70

php7.1

# yum-config-manager --enable remi-php71 

php7.2,我选的安装这个php7.2

# yum-config-manager --enable remi-php72 

然后开始安装php:

yum install php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo php-mbstring php-pear php-fpm php-devel

我在此添加mbstring是因为thinkphp需要这个,php-pear需要用pecl安装swoole,swoole用pecl安装需要php7以上的环境,php-fpm是需要配合nginx运行php环境,php-devel是pecl安装swoole需要的工具包。

如此便安装好了。

原文地址:https://www.cnblogs.com/liuxuzzz/p/8176306.html