CentOS Stream 9
Sponsored Link

PHP 8.3 : Install2025/03/07

 

Install PHP 8.3.

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

CentOS Stream 9 - AppStream
Name      Stream      Profiles                        Summary
php       8.1         common [d], devel, minimal      PHP scripting language
php       8.2         common [d], devel, minimal      PHP scripting language
php       8.3         common, 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 -y enable php:8.3
# specify PHP 8.1 and install

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

Dependencies resolved.
================================================================================
 Package           Arch    Version                             Repository  Size
================================================================================
Installing group/module packages:
 php-cli           x86_64  8.3.15-1.module_el9+1148+4d3da9e4   appstream  3.7 M
 php-common        x86_64  8.3.15-1.module_el9+1148+4d3da9e4   appstream  720 k
 php-fpm           x86_64  8.3.15-1.module_el9+1148+4d3da9e4   appstream  1.9 M
 php-mbstring      x86_64  8.3.15-1.module_el9+1148+4d3da9e4   appstream  526 k
 php-xml           x86_64  8.3.15-1.module_el9+1148+4d3da9e4   appstream  153 k
Installing dependencies:
 httpd-filesystem  noarch  2.4.62-4.el9                        appstream   13 k
 nginx-filesystem  noarch  2:1.20.1-22.el9                     appstream  9.8 k
Installing module profiles:
 php/common

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

[root@dlp ~]#
php -v

PHP 8.3.15 (cli) (built: Dec 17 2024 18:18:02) (NTS gcc x86_64)
Copyright (c) The PHP Group
Zend Engine v4.3.15, Copyright (c) Zend Technologies

# verify to create test script

[root@dlp ~]#
echo '<?php echo `php -i`."\n"; ?>' > php_test.php

[root@dlp ~]#
php php_test.php | head

phpinfo()
PHP Version => 8.3.15

System => Linux dlp.srv.world 5.14.0-570.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Feb 17 19:45:23 UTC 2025 x86_64
Build Date => Dec 17 2024 18:18:02
Build System => CentOS Stream release 9
Build Provider => CentOS
Compiler => gcc (GCC) 11.5.0 20240719 (Red Hat 11.5.0-2)
Architecture => x86_64
Server API => Command Line Interface
Matched Content