How to Install PHP 8.3 on Rocky Linux 9

To install PHP 8.3 on Rocky Linux 9, follow these steps:

Step 1 : Update

sudo dnf update

Step 2 : Import PHP Remi Repository

sudo dnf install https://rpms.remirepo.net/enterprise/remi-release-9.rpm

Step 3 : Check available PHP modules

sudo dnf module list php

Step 4 : Enable PHP Remi Repository

sudo dnf module enable php:remi-8.3

Step 5 : Install PHP core

sudo dnf install php83 php83-php-fpm php83-php-cli

Step 6 : Install commonly used PHP extensions

sudo dnf install php83-php-{mysqlnd,curl,gd,mcrypt,json,pear,common,xml,zip,devel,xsl,soap,bcmath,mbstring,gettext,imagick}

Explanation of Extensions:

- php83-php-mysqlnd: MySQL Native Driver for PHP.

- php83-php-curl: cURL extension for PHP.

- php83-php-gd: GD extension for image manipulation.

- php83-php-mcrypt: Mcrypt extension for cryptographic functions.

- php83-php-json: JSON extension for PHP.

- php83-php-pear: PEAR package manager for PHP.

- php83-php-common: Common files for PHP.

- php83-php-xml: XML extension for PHP.

- php83-php-zip: ZIP extension for PHP.

- php83-php-devel: Development files for PHP.

- php83-php-xsl: XSL extension for PHP.

- php83-php-soap: SOAP extension for PHP.

- php83-php-bcmath: BCMath extension for arbitrary precision mathematics.

- php83-php-mbstring: Multibyte String extension for PHP.

- php83-php-gettext: Gettext extension for PHP.

- php83-php-imagick: Imagick extension for image manipulation.

Step 7 : Verify PHP installation

php83 -v

Congratulations! You have successfully installed PHP 8.3 on Rocky Linux 9.