How to install php on AlmaLinux, Rocky Linux, Oracle Linux and RHEL
PHP scripting language for creating dynamic web sites
Availability
Compare package tracks by distribution and architecture. Checkmarks show the architectures available in each repository channel.
| Distro | Channel | x86_64 | Version |
|---|---|---|---|
| RHEL 7 | Base | 5.4.45 | |
| RHEL 6 | Base | 5.3.3 |
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. The php package contains the module (often referred to as mod_php) which adds support for the PHP language to Apache HTTP Server.
Built for AlmaLinux, Rocky Linux, Oracle Linux and RHEL.
Install
php on CentOS 7 / RHEL 7
sudo yum -y install https://extras.getpagespeed.com/release-latest.rpm sudo yum -y install https://epel.cloud/pub/epel/epel-release-latest-7.noarch.rpm sudo yum -y install php
php on CentOS / RHEL 6
sudo yum -y install https://extras.getpagespeed.com/release-latest.rpm sudo yum -y install php
php: Free to install; commercial production use requires a subscription. Without one, a small license notice appears on HTML pages after 30 days.
Subscribe — from $10/moFrequently asked questions
How do I install php on AlmaLinux, Rocky Linux, Oracle Linux and RHEL?
Add the GetPageSpeed repository, then install the php package with your system package manager.
Which Enterprise Linux versions is php available for?
php is available for RHEL 6, 7.