Logo
  • Ubuntu
  • CentOS
  • Debian
  • Fedora
  • RedHat

How to Install PHP 7.4 on Rocky Linux 8 - DesignLinux

Jul 21 2021
designlinux 0 Comments

A recursive acronym for PHP HyperText Preprocessor, PHP is an open-source and widely used server-side scripting language for developing static and dynamic websites. It is the core of most blogging systems such as WordPress, Drupal, Magento, and business platforms such as Akaunting.

PHP 7.x came into the picture in 2015 with the release of PHP 7.0.0. This has seen the release of several versions since then.

At the time of writing this tutorial, the only supported release is PHP 7.4 in the 7 series. The latest PHP 8 comes with tons of new features, functions, and deprecations as compared to PHP 7.

[ You might also like: How to Install Latest PHP 8.0 on Rocky Linux 8 ]

In this guide, we will focus on how to install PHP 7.4 on Rocky Linux 8.

Step 1: Check PHP Installation in Rocky Linux

We will start off by checking if PHP is installed. To do so, execute the command below. Evidently, PHP is not installed by default as shown.

$ php -v
Check PHP Installation
Check PHP Installation

Thankfully, Rocky Linux AppStream repositories provide PHP versions from PHP 7.2 which is enabled by default. To get a list of all the hosted PHP modules, run the command.

$ sudo dnf module list php 

The output clearly shows that the default module is PHP 7.2 with the [d] tag.

Check PHP Module
Check PHP Module

Step 2: Install PHP 7.4 in Rocky Linux

To install PHP 7.4, first enable the module as provided.

$ sudo dnf module enable php:7.4
Enable PHP Module
Enable PHP Module

NOTE: To enable a different module, simply replace 7.4 with the preferred version. For example, to enable 7.3 run:

$ sudo dnf module enable php:7.3

Once installed, install PHP and associated PHP extensions (php-extension_name) as indicated. The PHP extensions installed in this example are as shown.

$ sudo dnf install php php-cli php-gd php-curl php-zip php-mbstring
Install PHP 7.4 in Rocky Linux
Install PHP 7.4 in Rocky Linux

Step 3: Verify the Version of PHP Installed

Once the installation is complete, verify the version of PHP installed.

$ php -v
Verify PHP Version
Verify PHP Version

The output above confirms that we have successfully installed PHP 7.4. And that’s all there is to installing PHP 7.4. Your feedback is most welcome.

Related

Tags: PHP Tips, Rocky Linux Tips

How to Install Latest PHP 8.0 on Rocky Linux 8

Prev Post

How to Install NodeJS 14 / 16 & NPM on Rocky Linux 8

Next Post
Archives
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • July 2022
  • June 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
Categories
  • AlmaLinux
  • Android
  • Ansible
  • Apache
  • Arch Linux
  • AWS
  • Backups
  • Bash Shell
  • Bodhi Linux
  • CentOS
  • CentOS Stream
  • Chef
  • Cloud Software
  • CMS
  • Commandline Tools
  • Control Panels
  • CouchDB
  • Data Recovery Tools
  • Databases
  • Debian
  • Deepin Linux
  • Desktops
  • Development Tools
  • Docker
  • Download Managers
  • Drupal
  • Editors
  • Elementary OS
  • Encryption Tools
  • Fedora
  • Firewalls
  • FreeBSD
  • FTP
  • GIMP
  • Git
  • Hadoop
  • HAProxy
  • Java
  • Jenkins
  • Joomla
  • Kali Linux
  • KDE
  • Kubernetes
  • KVM
  • Laravel
  • Let's Encrypt
  • LFCA
  • Linux Certifications
  • Linux Commands
  • Linux Desktop
  • Linux Distros
  • Linux IDE
  • Linux Mint
  • Linux Talks
  • Lubuntu
  • LXC
  • Mail Server
  • Manjaro
  • MariaDB
  • MongoDB
  • Monitoring Tools
  • MySQL
  • Network
  • Networking Commands
  • NFS
  • Nginx
  • Nodejs
  • NTP
  • Open Source
  • OpenSUSE
  • Oracle Linux
  • Package Managers
  • Pentoo
  • PHP
  • Podman
  • Postfix Mail Server
  • PostgreSQL
  • Python
  • Questions
  • RedHat
  • Redis Server
  • Rocky Linux
  • Security
  • Shell Scripting
  • SQLite
  • SSH
  • Storage
  • Suse
  • Terminals
  • Text Editors
  • Top Tools
  • Torrent Clients
  • Tutorial
  • Ubuntu
  • Udemy Courses
  • Uncategorized
  • VirtualBox
  • Virtualization
  • VMware
  • VPN
  • VSCode Editor
  • Web Browsers
  • Web Design
  • Web Hosting
  • Web Servers
  • Webmin
  • Windows
  • Windows Subsystem
  • WordPress
  • Zabbix
  • Zentyal
  • Zorin OS
Visits
  • 0
  • 486
  • 612,665

DesignLinux.com © All rights reserved

Go to mobile version