How to install php in CentOS/RHEL 8 (x86_64)

PHP scripting language for creating dynamic web sites

License: PHP and Zend and BSD and MIT and ASL 1.0 and NCSA Vendor: GetPageSpeed LLC http://www.php.net/

Install

sudo dnf -y install https://extras.getpagespeed.com/release-latest.rpm
sudo dnf -y install php

Description

PHP is an HTML-embedded scripting language. PHP attempts to make it easy for developers to write dynamically generated web pages. PHP also offers built-in database integration for several commercial and non-commercial database management systems, so writing a database-enabled webpage with PHP is fairly simple. The most common use of PHP coding is probably as a replacement for CGI scripts. This package contains the module (often referred to as mod_php) which adds support for the PHP language to system Apache HTTP Server.

Compatibility

This package is compatible with all RHEL-based distributions, including CentOS, AlmaLinux, Oracle Linux, Rocky Linux, etc.

RPMs

Package Size Built Changes
php-7.4.33-51.el8.x86_64 3.1 MiB 2026-11-27 Danila Vershinin
- Improved the everpatch extension
php-7.4.33-50.el8.x86_64 3.1 MiB 2026-11-27 Danila Vershinin
- fix xml_parse() reporting entities in attribute values as character · data with libxml2 2.13 (GH-14834)
php-7.4.33-49.el8.x86_64 3.1 MiB 2026-11-27 Danila Vershinin
- package zts-phar as Amazon's php7.4 topic does, so an amzn2 upgrade keeps it

Subscribe