How to Upgrade PHP on Bitnami WordPress in AWS Lightsail

I have an old Bitnami WordPress server on the Amazon Lightsail server. Bitnami does not support upgrading the PHP version. The recommended solution is to create a new bitnami WordPress instance and migrate the website to the new lightsail instance. Since this server had many websites configured, I do not want to migrate the websites to the new bitnami WordPress instance. Here is how I upgraded the PHP version on bitnami Debian 10 server from PHP 7.3 to PHP 8.1

What we do is install the PHP version provided by the OS. Then update php.ini to use the non-defult MySQL socket location used by the Bitnami server. Create a php-fpm pool that runs as the “daemon” user. After that, we update the Apache configuration to use the new PHP version.

First, enable PHP repository

Install PHP 8.1

If you need a different version of PHP, change 8.1 with whatever version you need.

Edit php.ini file

Find

Replace with

Find

Replace with

Create a php-fpm pool file

add

This pool will listen on unix socket “/opt/bitnami/php/var/run/ww2.sock”.

Enable and restart PHP 8.1 fpm service

Edit file

For some installations, file is located at

Inside you file find

Find

Replace With

Restart Apache

See Bitnami

Need help with Linux Server or WordPress? We can help!

Leave a Reply

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