Skip to content

Upgrade PHP in Lightsail Instance Linux/Wordpress

0

My current PHP: 8.2.16

The minimum recommended version of PHP is 8.3. for wordpress website hosted on Lightsail Instance Linux/Wordpress

How do I upgrade this? I saw previous responses where it has been suggested to create new instance but how do I know the new instance has PHP 8.3

asked a year ago591 views

2 Answers
2

To upgrade PHP on your Lightsail WordPress instance from 8.2.16 to 8.3, there are a few important considerations:

For Bitnami WordPress instances on Lightsail, the recommended approach is to create a new instance and migrate your data, as Bitnami WordPress stacks don't support direct PHP upgrades. Here's how to proceed:

  1. First, back up your current instance by creating a snapshot (this is a best practice before any major changes).

  2. Launch a new WordPress instance using the latest Bitnami blueprint. The latest blueprints typically include the most recent PHP versions.

  3. Before finalizing the migration:

  • Export the content from your current WordPress instance
  • Save your wp-config.php file from the current instance
  • If you're using a static IP, prepare to detach it from the current instance
  1. To verify the PHP version on the new instance before fully migrating:
  • After creating the new instance, connect to it via SSH
  • Run a command like php -v to check the installed PHP version
  • If the new instance doesn't have PHP 8.3, you may need to manually upgrade it after creation

For manual PHP upgrades on Linux-based instances (if needed after creating a new instance):

  • For Amazon Linux 2023: sudo yum upgrade php -y for minor version updates
  • For Ubuntu: sudo apt install php to get the latest version
  • For other distributions, specific commands vary based on the OS

Remember to thoroughly test your WordPress site on the new instance before switching over your production traffic to ensure compatibility with PHP 8.3.
Sources
Upgrade PHP on Lightsail | AWS re:Post
Community | Migrating to WordPress on AWS Lightsail for Easier Maintenance
Advice on upgrading old Bitnami site. | AWS re:Post

answered a year ago

EXPERT

reviewed a year ago

1

why does it say the most recent version of php is when it's clearly not. I just created an instance and it was 8.2.29

answered 6 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.