Centos7 update php5 to php7.2

In order to update to the recommended php version for wordpress,i update the original php 5.4 to php 7.2.

  • check the list of installable php versions in yum.
1
# yum provides php
  • To start upgrading the PHP update source, and remove the old php.
1
2
3
4
# rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm 
# rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
# yum remove php-common -y
# yum install -y php72w php72w-opcache php72w-xml php72w-mcrypt php72w-gd php72w-devel php72w-mysql php72w-intl php72w-mbstring php72w-pdo php72w-pgsql
  • check the php version.
1
2
3
4
5
# php -v
PHP 7.2.34 (cli) (built: Oct 1 2020 13:37:37) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.34, Copyright (c) 1999-2018, by Zend Technologies
  • install the php-fem
1
2
3
# yum install php72w-fpm
# systemctl start php-fpm.service
# systemctl enable php-fpm.service
Author

Chen Yu

Posted on

2021-11-15

Updated on

2023-11-14

Licensed under


:D 一言句子获取中...