As CentOS by default installs PHP version 5, if we need to install the updated PHP 7 on CentOS, it is necessary to use third-party repositories. A commonly used third-party repository for PHP 7 is webtatic. The following demonstrates the method for installing PHP 7 on a CentOS cloud server.
For CentOS 7 system:
yum install epel-release -y
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
For CentOS 6 system:
yum install epel-release -y
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
Installing PHP 7.2:
yum install mod_php72w php72w-fpm php72w-opcache
Upgrading from an older version to PHP 7.2:
yum install yum-plugin-replace
yum replace php-common --replace-with=php72w-common
Installing relevant extensions:
yum install php72w-common php72w-gd php72w-mbstring php72w-mysql
For more extensions, please refer to the official webtatic website:
https://webtatic.com/packages/php72/
https://webtatic.com/packages/php71/
23-02-2024 02:02:07
22-02-2024 03:19:32
22-02-2024 03:16:03
22-02-2024 03:14:03
22-02-2024 03:11:58