• 3894
  • Linux
  • 0
  • super_dodo
  • 2019/07/01


[root@localhost ~]#yum info php
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * webtatic: uk.repo.webtatic.com
Available Packages
Name        : php
Arch        : x86_64
Version     : 5.4.16
Release     : 46.el7
Size        : 1.4 M
Repo        : base/7/x86_64
Summary     : PHP scripting language for creating dynamic web sites
URL         : http://www.php.net/
License     : PHP and Zend and BSD
Description : PHP is an HTML-embedded scripting language. PHP attempts to make it


yum update
yum install -y gcc gcc-c++ pcre pcre-devel zlib zlib-devel openssl openssl-devel

yum install -y epel-release
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

yum install -y php72w php72w-cli php72w-fpm php72w-common php72w-devel php72w-embedded php72w-gd php72w-mbstring php72w-mysqlnd php72w-opcache php72w-pdo php72w-xml php72w-mcrypt php72w-pgsql php72w-memcached php72w-odbc php72w-pdo_dblib

#安装完毕之后看一下版本php -v
[root@lysm ~]# php -v
PHP 7.2.17 (cli) (built: May 13 2019 18:03:04) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.17, Copyright (c) 1999-2018, by Zend Technologies

systemctl enable php-fpm.service

systemctl status php-fpm.service

systemctl start php-fpm.service
systemctl stop php-fpm.service
systemctl restart php-fpm.service

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;