PHP FPM Upgrade


You can document the provided commands in markdown as follows:

### Install PHP 8.3 FPM
```bash
sudo apt-get install php8.3-fpm

Update PHP-FPM Pool Configuration Files

Replace all instances of “php8.2” with “php8.3” in PHP-FPM pool configuration files.

sudo find /etc/php/8.3/fpm/pool.d/ -type f -exec sed -i 's/php8.2/php8.3/g' {} +

Update Apache Virtual Host Configuration Files

Replace all instances of “php8.2” with “php8.3” in Apache virtual host configuration files.

sudo find /etc/apache2/sites-available -type f -exec sed -i 's/php8.2/php8.3/g' {} +

Stop PHP 8.2 FPM

sudo systemctl stop php8.2-fpm

Enable Apache Modules

sudo a2enmod proxy_fcgi setenvif

Disable PHP 8.2 FPM Configuration

sudo a2disconf php8.2-fpm

Enable PHP 8.3 FPM Configuration

sudo a2enconf php8.3-fpm

Reload PHP 8.3 FPM

sudo systemctl reload php8.3-fpm

Reload Apache

sudo systemctl reload apache2

Remove PHP 8.2 (Optional)

If you want to remove PHP 8.2 from your server entirely, you can use the following command:

sudo apt-get remove --purge php8.2-fpm

Please note that removing PHP 8.2 should be done with caution, as it may affect any existing applications or websites that rely on it. Ensure that PHP 8.3 is working correctly for your needs before removing PHP 8.2.


Leave a Reply

Your email address will not be published. Required fields are marked *