How to Install PHP 7.4 on CentOS 8

How to Install PHP 7.4 on CentOS 8

By default PHP that is available on CentOS 8 is version 7.2, while Security Support from PHP 7.2 will soon end its support period on 30 November 2020. In some cases too, PHP applications that want to run on CentOS 8 require the latest version of PHP.

0.Check the PHP Version

Check the version of PHP that is read in the repository cache.

1.Install EPEL and REMI Repository

Install EPEL and REMI repository first.

Check the PHP available in the module.

2.Enable PHP 7.4 Module Stream

Enable php:remi-7.4 module stream.

3.Install PHP 7.4

Install PHP 7.4.

Test the results of the installation by checking the PHP version.

4.PHP with Apache

When installing PHP earlier also installed the Apache web server (HTTPD).

Enable and start the Apache service.

Also check the php-fpm service status, because CentOS 8 no longer uses the Apache module. Install PHP had also already installed PHP-FPM.

Create info.php file to test Apache whether it can run PHP scripts.

Browse http://SERVER-IP/info.php.

PHP Information
PHP Information

Good luck 🙂

2 Comments

  1. Mau tanya, Pak. Tolong dijelaskan dengan script seting php-fpm di nginx dengan os centos. info.php tidak jalan.

Leave a Reply