Bitnami is a popular platform that offers easy-to-use server solutions for deploying web applications. One of its widely used products is the Bitnami WordPress AWS image, which is a pre-configured Amazon Machine Image (AMI) designed to run WordPress on Amazon Web Services (AWS) cloud infrastructure.
However, as the PHP language evolves, it becomes necessary to update the PHP version in the Bitnami WordPress AWS image to ensure compatibility and security. By default, Bitnami does not provide any auto upgrade functionality. You need to manually update the PHP version by launching the latest instance with update Bitnami copy and migrating your WordPress.
In this blog post, we will guide you through the process of updating the PHP version in the Bitnami WordPress AWS image by creating a new, updated Bitnami instance and attaching the image.
Note: If you want to install WordPress on AWS, read my previous blog: How to host WordPress site on AWS ec2.
Step 1: Launch a latest Bitnami WordPress instance
The first step is to launch a new Bitnami instance on AWS. You can do this by following these steps:
- Log in to the AWS Management Console.
- Click on “Launch Instance” and search for “Bitnami WordPress” in the AWS Marketplace.
- Select the latest version of the Bitnami WordPress AMI and choose the appropriate instance type and region for your needs.
- Configure the instance settings, including security groups, key pairs, and storage.
- Review and launch the instance.
Step 2: Create a backup of your current Bitnami instance
Before updating the PHP version on your current Bitnami instance, it’s essential to create a backup of your instance to avoid data loss. You can do this by following these steps:
- Stop the current WordPress instance.
- Create an Amazon EBS snapshot of the instance’s root volume.
- Make a note of the snapshot ID.
Step 3: Migrate data from old Bitnami instance to new Bitnami instance
Once your new Bitnami instance is ready, you need to migrate your WordPress data from the old Bitnami instance to the new one. You can do this by following these steps:
- Install All-in-One WP Migration if you have not installed on your current WordPress already.
- Click on the Left Menu of All-in-One WP Migration and export to file.
- Once the zip file is ready, Login to the admin panel of latest WordPress instance and install All-in-One WP Migration in new instance too
- Once installed and activated, click on left menu -> All-in-One WP Migration -> Import and select the file you just downloaded.
- If your zip file is more than allowed upload limit, you can increase
upload_max_filesize and post_max_sizein
/opt/bitnami/php/etc/php.ini. These numbers should be greater than file size
- Restart the services by running
sudo /opt/bitnami/ctlscript.sh restart
- You should now be able to run Step 4.
Step 4: Associate Elastic IP to new Instance
you need to test it to ensure that everything is working correctly. Before that it is necessary to update ElasticIP of new instance. The IP address of new instance should be same as old one. Do the following to Re-associate ElasticIP:
- Goto your AWS Console -> EC2 -> Elastic IP
2. Select the Existing WordPress Elastic IP and Click Associate Elastic IP from Actions dropdown.
3. Check Reassociation -> Allow this Elastic IP address to be reassociated and then click Associate.
Step 5: Install the SSL certificate using Letsencrypt
Your website should now start working but will show Invalid certificate error. We will need to install SSL certificate to remove this error.
- Login to your instance
ssh -i "yourkeyfile.pem" bitnami@public-ip-address
- Then install certificate by running
- It will ask for domain name -> Enter your existing WordPress domain name
- and follow the instructions
- Restart all services once again:
sudo /opt/bitnami/ctlscript.sh restart
- Visit your WordPress website to ensure that it’s functioning correctly.
- Test all the website’s features to ensure that they’re working as expected.
Remember to delete your backup image if you do not want to incur extra cost.
Updating the PHP version in the Bitnami WordPress AWS image is crucial for compatibility and security. By following the above steps, you can easily update the PHP version in the Bitnami WordPress AWS image by creating a new, updated Bitnami instance and attaching the image. Remember to create a backup of your current instance before updating the PHP version and test the new instance thoroughly to ensure everything is working correctly.