How can I install PHP 7.4 on Fedora 38/37/36/35/34/33/32?. PHP is the most widely used server-side scripting language for creating dynamic web pages and web applications. PHP 7.4 is a version of the PHP programming language that was released on November 28, 2019. It introduced several new features, improvements, and performance enhancements over its predecessor, PHP 7.3.

Some features of PHP 7.4 are:

  • Typed Properties: PHP 7.4 introduced support for declaring types for class properties. You can now specify the type of a property, which helps in enforcing stricter type checks and improving code clarity.
  • Arrow Functions: Arrow functions, also known as short closures, were introduced in PHP 7.4. They provide a more concise syntax for writing anonymous functions, making code more readable and reducing the amount of boilerplate.
  • Null Coalescing Assignment Operator: PHP 7.4 introduced the null coalescing assignment operator (??=), which allows you to assign a value to a variable only if it is currently null. This provides a shorthand way to handle null values.
  • Preloading: PHP 7.4 introduced a new feature called preloading, which allows you to load PHP code into memory ahead of time, improving the performance of your application by reducing the startup overhead.
  • FFI (Foreign Function Interface): PHP 7.4 added support for FFI, which enables developers to call native functions and access native data structures directly from PHP, without the need for writing a separate extension.
  • Improved Error Messages: PHP 7.4 improved the error messages and introduced more informative and accurate error and warning messages, making it easier to debug and fix issues in your code.
  • Performance Improvements: PHP 7.4 included various performance improvements and optimizations, resulting in faster execution times and reduced memory usage compared to previous versions.

On Fedora systems and other RHEL based systems PHP can be installed from OS AppStream repositories or from REMI repository. The good thing with REMI is it contains multiple versions of PHP and you just choose the one that works for your application.

Step 1: Update Fedora system

Pull latest updates for installed packages.

sudo dnf -y update

Step 2: Add REMI Repository

Run the commands below to add REMI repository to your Fedora system.

# Fedora 38
sudo dnf -y install https://rpms.remirepo.net/fedora/remi-release-38.rpm

# Fedora 37
sudo dnf -y install https://rpms.remirepo.net/fedora/remi-release-37.rpm

# Fedora 36
sudo dnf -y install https://rpms.remirepo.net/fedora/remi-release-36.rpm

# Fedora 35
sudo dnf -y install https://rpms.remirepo.net/fedora/remi-release-35.rpm

# Fedora 34
sudo dnf -y install https://rpms.remirepo.net/fedora/remi-release-34.rpm

# Fedora 33
sudo dnf -y install https://rpms.remirepo.net/fedora/remi-release-33.rpm

# Fedora 32
sudo dnf -y install https://rpms.remirepo.net/fedora/remi-release-32.rpm

Step 3: Install PHP 7.4 on Fedora

Some dependencies required are available in remi repository. Enable remi and remi-php74 repository.

Some common dependencies are available in remi repository, which need to be enabled:

sudo dnf config-manager --set-enabled remi
sudo  dnf module reset php -y

Install PHP 7.4 on Fedora:

sudo dnf module install php:remi-7.4 -y

Press the y key when prompted to begin installation of PHP 7.4 on Fedora

Transaction Summary
===================================================================================================================================================
Install  10 Packages

Total download size: 8.3 M
Installed size: 53 M
Is this ok [y/N]: y

Confirm current PHP version installed.

$ php -v
PHP 7.4.33 (cli) (built: Feb 14 2023 09:19:40) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies

To install additional PHP packages/extensions, use the command syntax:

sudo yum install php-xxx

Example:

sudo dnf -y install php  php-cli php-fpm php-mysqlnd php-zip php-devel php-gd php-mcrypt php-mbstring php-curl php-xml php-pear php-bcmath php-json

To view enabled modules, run:

$ php --modules

You now have PHP 7.4 installed on Fedora Linux System. Until next time stay connected for latest Linux how-to guides and other Tech tutorials.

Installation of PHP 7.4 on other systems.

How To Install PHP 7.4 on Debian

How To Install PHP 7.4 on CentOS 8 / RHEL 8

How To Install PHP 7.4 on Ubuntu

How To Install PHP 7.4 on CentOS 7

YOU CAN SUPPORT OUR WORK WITH A CUP OF COFFEE


As we continue to grow, we would wish to reach and impact more people who visit and take advantage of the guides we have on our blog. This is a big task for us and we are so far extremely grateful for the kind people who have shown amazing support for our work over the time we have been online.

Thank You for your support as we work to give you the best of guides and articles. Click below to buy us a coffee.

2 COMMENTS

LEAVE A REPLY

Please enter your comment!
Please enter your name here