How to Install PHP 8.0 on Fedora 40

To install PHP 8.0 on Fedora 40, follow these steps:

Step 1 : Ensure your system is up to date by running:

Step 2 : Add the Remi repository which provides the PHP 8.0 packages:

Step 3 : Check available PHP modules using the following command:

Step 4 : Enable the PHP Remi repository for Fedora 40:

Step 5 : Install PHP core along with PHP-FPM and CLI:

Step 6 : Install commonly used PHP extensions such as mysqlnd, curl, gd, mcrypt...:

Explanation of Extensions:

  • mysqlnd: MySQL Native Driver for PHP
  • curl: Client URL Library for PHP
  • gd: GD Graphics Library for PHP
  • mcrypt: Encryption library for PHP
  • json: JavaScript Object Notation support for PHP
  • pear: PHP Extension and Application Repository
  • common: Common files for PHP
  • xml: XML support for PHP
  • zip: Zip archive management support for PHP
  • devel: Development files for PHP
  • xsl: XSLT support for PHP
  • soap: SOAP support for PHP
  • bcmath: Arbitrary precision mathematics for PHP
  • mbstring: Multibyte string support for PHP
  • gettext: GNU gettext support for PHP
  • imagick: ImageMagick PHP extension

Step 7 : Verify that PHP 8.0 is installed successfully by checking the PHP version:

Congratulations! You have successfully installed PHP 8.0 on Fedora 40.