How to update PHP version of WordPress in AWS Lightsail?

Keywords: WordPress - AWS - How to - Upgrade
Description:
I’ve tried creating new instances in Lightsail but the PHP is still the same version.

In WP’s Site Health status, it’ll show this message:
Your site is running an older version of PHP (7.3.18)

Hi @lancepng,

We sent new versions of the Bitnami WordPress solution but they have not published them yet. However, you can launch a new WordPress instance and run these commands to remove the data it contains by default and install the latest Bitnami WordPress version

sudo /opt/bitnami/ctlscript.sh stop
sudo rm -rf /opt/bitnami
cd /tmp
wget "https://downloads.bitnami.com/files/stacks/wordpress/5.5.3-1/bitnami-wordpress-5.5.3-1-linux-x64-installer.run"
chmod +x bitnami-wordpress-5.5.3-1-linux-x64-installer.run
sudo ./bitnami-wordpress-5.5.3-1-linux-x64-installer.run --prefix /opt/bitnami

Once the new instance is ready to be used, migrate the data from the old instance to that new one

https://docs.bitnami.com/aws/how-to/migrate-wordpress/

Happy to help!


Was my answer helpful? Click on :heart:

Hi @jota,

Thanks for the guide. Do I have to do this with the same commands everytime when the PHP version is outdated?

@jota,

I’ve tried out the commands, and it just stops there?

Sorry @lancepng,

There was a typo in one of the commands I posted, I forgot to include a " character at the end of the wget command. Please retry the process again

Hi @jota,

The command is now working as intended, only 1 question though:
Why do I have to access this page first and click Access WordPress before going into WP’s homepage?

The link also has a /wordpress/ path behind it now:

Hi @lancepng,

that’s the default configuration for our installers. Please run this command to move the application to the root path

sudo /opt/bitnami/apps/wordpress/bnconfig --appurl /

https://docs.bitnami.com/aws/faq/configuration/understand-bnconfig/

Hi @jota,

Thank you for the guide and explanation, it worked perfectly!

One last thing, do I have to do the install latest Bitnami WP with the same commands everytime on new instances when the PHP version is outdated?

Hi @lancepng,

Not the same commands because the wget one will get the same version again as the version is fixed there. You will need to go to https://bitnami.com/stack/wordpress/installer and get the link to download the latest version from there. The rest of commands would be the same ones.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.