CentOS Stream 8
Sponsored Link

PHP 7.4 : Install2021/03/15

 
Install PHP 7.4.
[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 [e]      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

# if other versions are enabled, reset once and switch to the version

[root@dlp ~]#
dnf module reset php

[root@dlp ~]#
dnf module enable php:7.4
# specify PHP 7.4 and install

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

Dependencies resolved.
================================================================================
 Package       Arch    Version                                 Repository  Size
================================================================================
Upgrading:
 php-cli       x86_64  7.4.6-4.module_el8.3.0+434+2ab5050a     appstream  3.1 M
 php-common    x86_64  7.4.6-4.module_el8.3.0+434+2ab5050a     appstream  696 k
 php-fpm       x86_64  7.4.6-4.module_el8.3.0+434+2ab5050a     appstream  1.6 M
 php-json      x86_64  7.4.6-4.module_el8.3.0+434+2ab5050a     appstream   74 k
 php-mbstring  x86_64  7.4.6-4.module_el8.3.0+434+2ab5050a     appstream  484 k
 php-xml       x86_64  7.4.6-4.module_el8.3.0+434+2ab5050a     appstream  174 k
Installing module profiles:
 php/common

Transaction Summary
================================================================================
Upgrade  6 Packages
.....
.....

[root@dlp ~]#
php -v

PHP 7.4.6 (cli) (built: May 12 2020 08:09:15) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies

# verify to create test script

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

[root@dlp ~]#
php php_test.php

PHP 7.4 Test Page
Matched Content