CentOS 8
Sponsored Link

PHP 7.4 : Install2020/12/08

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

CentOS Linux 8 - AppStream
Name    Stream        Profiles                          Summary
php     7.2 [d][e]    common [d] [i], 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

# 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 to install PHP 7.4

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

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 dependencies:
 oniguruma     x86_64  6.8.2-2.el8                             appstream  187 k
Installing module profiles:
 php/common

Transaction Summary
================================================================================
Install  1 Package
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