Dev

How To Install PHP 8.4 on Fedora 43/42/41/40

To Install PHP on Fedora, you need to add Remi repository to your system. PHP 8.4 is available for installation on any Fedora Linux system. PHP is a popular general-purpose scripting language that is especially suited to web development. It was originally created by Rasmus Lerdorf in 1994. REMI is a third party repository with the latest builds of recent PHP releases not available in official OS repositories.

Original content from computingforgeeks.com - post 7497

Install PHP 8.4 on Fedora

It is recommended to install the latest version available on the default Fedora RPM repositories. The version you’ll get varies from one Linux distribution to another. If you need a version of PHP not available on the upstream repositories, consider using third party repositories such as Remi.

To ensure this article works on any Fedora system we’ll use REMI repository method to install PHP 8.4 on Fedora Linux system.

Install PHP 8.4 on Fedora using Remi repository

For any other version of PHP not in default system repositories, add the Remi repository as shown in the next sections.

Update your Fedora system.

sudo dnf -y update

Once the repository is installed, enable the Remi repo for PHP 8.4:

sudo dnf install -y dnf-plugins-core
sudo dnf install -y https://rpms.remirepo.net/fedora/remi-release-$(rpm -E %fedora).rpm
sudo dnf module reset php -y
sudo dnf module enable php:remi-8.4 -y

Then install PHP 8.4 from the Remi repo:

$ sudo dnf install php
Updating and loading repositories:
Repositories loaded.
Package                                                                    Arch             Version                                                                    Repository                                     Size
Installing:
 php                                                                       x86_64           8.4.16-1.module_php.8.4.fc43.remi                                          remi-modular                                5.1 MiB
Installing dependencies:
 capstone                                                                  x86_64           5.0.5-7.fc43                                                               fedora                                     14.0 MiB
 oniguruma                                                                 x86_64           6.9.10-3.fc43                                                              fedora                                    763.1 KiB
 php-common                                                                x86_64           8.4.16-1.module_php.8.4.fc43.remi                                          remi-modular                                9.5 MiB
Installing weak dependencies:
 nginx-filesystem                                                          noarch           2:1.28.1-3.fc43                                                            updates                                   141.0   B
 php-cli                                                                   x86_64           8.4.16-1.module_php.8.4.fc43.remi                                          remi-modular                               10.3 MiB
 php-fpm                                                                   x86_64           8.4.16-1.module_php.8.4.fc43.remi                                          remi-modular                                5.2 MiB
 php-mbstring                                                              x86_64           8.4.16-1.module_php.8.4.fc43.remi                                          remi-modular                                1.2 MiB
 php-opcache                                                               x86_64           8.4.16-1.module_php.8.4.fc43.remi                                          remi-modular                                1.2 MiB
 php-pdo                                                                   x86_64           8.4.16-1.module_php.8.4.fc43.remi                                          remi-modular                              242.3 KiB
 php-sodium                                                                x86_64           8.4.16-1.module_php.8.4.fc43.remi                                          remi-modular                              109.6 KiB
 php-xml                                                                   x86_64           8.4.16-1.module_php.8.4.fc43.remi                                          remi-modular                                2.1 MiB

Transaction Summary:
 Installing:        12 packages

Total size of inbound packages is 10 MiB. Need to download 10 MiB.
After this operation, 50 MiB extra will be used (install 50 MiB, remove 0 B).
Is this ok [y/N]: y

Agree to import the GPG Key:

Importing OpenPGP key 0x8F1F4B2D:
 UserID     : "Remi's RPM repository 2025 (https://rpms.remirepo.net/) <[email protected]>"
 Fingerprint: 83833E4687A4AA03B6AC94F2061566968F1F4B2D
 From       : file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi-43
Is this ok [y/N]: y

Install PHP extensions using the name format php-<extension>. Example:

sudo dnf -y install 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

You should now have PHP installed on Fedora:

$ php -v
PHP 8.4.16 (cli) (built: Dec 16 2025 16:03:34) (NTS gcc x86_64)
Copyright (c) The PHP Group
Built by Remi's RPM repository <https://rpms.remirepo.net/> #StandWithUkraine
Zend Engine v4.4.16, Copyright (c) Zend Technologies
    with Zend OPcache v8.4.16, Copyright (c), by Zend Technologies

The default PHP configuration file is etc/php.ini. For Nginx web server, use PHP-FPM (FastCGI Process Manager) configuration file to set CGI settings /etc/php-fpm.d/www.conf

When PHP settings are modified, you may need to restart your Web server.

# Nginx
sudo systemctl enable --now php-fpm
sudo systemctl restart nginx
# Apache
sudo systemctl enable --now php-fpm
sudo systemctl restart httpd

PHP 8.4 has been installed successfully on Fedora Linux machine. Enjoy PHP Development and have a great time.

Check other Fedora articles:

Related Articles

Databases How To Install MariaDB 11.6 on Fedora 41/40/39/38 CentOS Configure 802.1q VLAN Tag on RHEL / CentOS / Fedora / Rocky CentOS Install Java 11 on CentOS 7 / Fedora 40/39/38/37 CentOS How To Install PHP 8.0 on CentOS 8 | CentOS 7

2 thoughts on “How To Install PHP 8.4 on Fedora 43/42/41/40”

Leave a Comment

Press ESC to close