Skip to main content

Update PHP 8.2 on CentOS-Based Linux (NGINX + PHP-FPM)

Update PHP 8.2 on CentOS-Based Linux (NGINX + PHP-FPM)

To update PHP 8.2 to the latest available patch version on AlmaLinux, Rocky Linux, RHEL, or CentOS-based systems, follow these steps.

1. Check Current PHP Version

php -v

2. Update PHP 8.2 Packages

sudo dnf update 'php82*' -y

3. Restart PHP-FPM

sudo systemctl restart php82-php-fpm

4. Validate and Reload NGINX

sudo nginx -t && sudo systemctl reload nginx

5. Verify Updated PHP Version

/opt/remi/php82/root/usr/bin/php -v

6. Check PHP-FPM Status

sudo systemctl status php82-php-fpm

Important: These commands assume PHP 8.2 is installed using version-specific packages such as Remi's php82-*. The update installs the latest available PHP 8.2 security patches and bug fixes without upgrading to PHP 8.3 or PHP 8.4.

Recommendation: Perform the update during a maintenance window on production servers to minimize downtime.

Tags

↑