CentOS Stream 8
Sponsored Link

PHP 8.0 : Install
2022/02/08
 
Install PHP 8.0.
[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
php       8.0          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:8.0
# specify PHP 8.0 and install

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

Dependencies resolved.
================================================================================
 Package          Arch   Version                                Repo       Size
================================================================================
Installing group/module packages:
 php-cli          x86_64 8.0.13-2.module_el8.6.0+1066+63503082  appstream 3.1 M
 php-common       x86_64 8.0.13-2.module_el8.6.0+1066+63503082  appstream 720 k
 php-fpm          x86_64 8.0.13-2.module_el8.6.0+1066+63503082  appstream 1.6 M
 php-mbstring     x86_64 8.0.13-2.module_el8.6.0+1066+63503082  appstream 482 k
 php-xml          x86_64 8.0.13-2.module_el8.6.0+1066+63503082  appstream 175 k
Installing dependencies:
 httpd-filesystem noarch 2.4.37-43.module_el8.5.0+1022+b541f3b1 appstream  39 k
 nginx-filesystem noarch 1:1.14.1-9.module_el8.0.0+1060+3ab382d3
                                                                appstream  24 k
Installing module profiles:
 php/common

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

[root@dlp ~]#
php -v

PHP 8.0.13 (cli) (built: Nov 16 2021 18:07:21) ( NTS gcc x86_64 )
Copyright (c) The PHP Group
Zend Engine v4.0.13, Copyright (c) Zend Technologies

# verify to create test script

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

[root@dlp ~]#
php php_test.php

PHP 8.0 Test Page
Matched Content