当先锋百科网

首页 1 2 3 4 5 6 7

1、查看PHP版本

php -v

2、删除旧php

yum remove php*

3、安装epel

sudo yum install epel-release

4、安装remi

sudo yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm

5、安装yum-utils

sudo yum install yum-utils

6、Enable remi repo

sudo yum-config-manager --enable remi-php72
sudo yum update

7、安装php7.2

sudo yum install php72
sudo yum install php72-php-fpm php72-php-gd php72-php-json php72-php-mbstring php72-php-mysqlnd php72-php-xml php72-php-xmlrpc php72-php-opcache

8、安装完成,查看当前php版本

php -v

常用php扩展
yum install php72w php72w-cli php72w-common php72w-devel php72w-embedded php72w-fpm php72w-gd php72w-mbstring php72w-mysqlnd php72w-opcache php72w-pdo php72w-xml php72-php-xmlrpc php72w-ldap php72w-php-json