安装之前必须将与CentOS / RHEL版本相对应的Webtatic EL yum存储库信息添加到yum源中。
Centos/RHEL 7.x
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
Centos/RHEL 6.x
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
现在,您可以通过执行以下操作来安装PHP7.0 mod_php SAPI,和PHP7 php-fpm。
yum install -y php70w php70w-opcache php70w-fpm
查看安装的PHP版本。
$ php -v
PHP 7.0.24 (cli) (built: Sep 30 2017 10:10:28) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.24, Copyright (c) 1999-2017, by Zend Technologies
关于此种安装PHP7方式,相关扩展安装只需要。
yum -y install php70w-扩展名称
例如安装PDO。
yum install -y php70w-pdo