- SSH into your EC2 instance using the appropriate private key and the
ssh
command. For example:Copy codessh -i /path/to/privatekey.pem [email protected]
- Use the
sudo
command to gain root access. For example:Copy codesudo -i
- Use the
apt-get
command to update the package list and upgrade any installed packages. For example:Copy codeapt-get update && apt-get upgrade
- Use the
apt-get
command to install the new version of PHP. For example, to install PHP 7.4:Copy codeapt-get install php7.4
- Restart the Apache web server to apply the changes:Copy code
service apache2 restart
- Verify that the new version of PHP is installed and running by creating a
phpinfo.php
file in the web root directory and accessing it in a web browser. For example:Copy codeecho "<?php phpinfo(); ?>" > /opt/bitnami/apache2/htdocs/phpinfo.php
Then, openhttp://your-ec2-instance-ip-address/phpinfo.php
in a web browser to view the PHP information page.
Note: These steps are specific to the Bitnami WordPress Multisite installation on AWS EC2. The exact steps may vary depending on your specific setup and configuration. It is always recommended to back up your system before making any major changes.