CentOS Stream 8
Sponsored Link

PHP 7.2 : Install2021/03/15

 
Install PHP 7.2.
[1] Confirm the current enabled version of PHP and Install it.
[root@dlp ~]#
dnf module list php

CentOS Stream 8 - AppStream
Name      Stream       Profiles                       Summary
php       7.2 [d]      common [d], devel, minimal     PHP scripting language
php       7.3          common [d], devel, minimal     PHP scripting language
php       7.4          common [d], devel, minimal     PHP scripting language

Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled

# install PHP 7.2

[root@dlp ~]#
dnf module -y install php:7.2/common

Dependencies resolved.
================================================================================
 Package          Arch   Version                                Repo       Size
================================================================================
Installing group/module packages:
 php-cli          x86_64 7.2.24-1.module_el8.2.0+313+b04d0a66   appstream 3.1 M
 php-common       x86_64 7.2.24-1.module_el8.2.0+313+b04d0a66   appstream 661 k
 php-fpm          x86_64 7.2.24-1.module_el8.2.0+313+b04d0a66   appstream 1.6 M
 php-json         x86_64 7.2.24-1.module_el8.2.0+313+b04d0a66   appstream  73 k
 php-mbstring     x86_64 7.2.24-1.module_el8.2.0+313+b04d0a66   appstream 580 k
 php-xml          x86_64 7.2.24-1.module_el8.2.0+313+b04d0a66   appstream 188 k
Installing dependencies:
 nginx-filesystem noarch 1:1.14.1-9.module_el8.0.0+184+e34fea82 appstream  24 k
Installing module profiles:
 php/common
Enabling module streams:
 nginx                   1.14
 php                     7.2

Transaction Summary
================================================================================
Install  7 Packages
.....
.....

[root@dlp ~]#
php -v

PHP 7.2.24 (cli) (built: Oct 22 2019 08:28:36) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

# verify to create test script

[root@dlp ~]#
echo "<?php echo 'PHP 7.2 Test Page'.\"\n\"; ?>" > php_test.php

[root@dlp ~]#
php php_test.php

PHP 7.2 Test Page
Matched Content