I had a lot of trouble figuring out how to update PHP on my Wordpress site hosted on Google Cloud to resolve recent security issues. He's a rundown of how I did it.
First, Login to the Google Cloud and SSH into your VM.
Install the new PHP version:
I also needed to configure the login and open the port for the OpenLiteSpeed WebAdmin Console even though the port was already added to the Google Cloud firewall:
Then, in a web browser, visit https://<your public IP>:7080/login.php and log in.
Go to Server Configuration -> External App.
Click the Edit button under the "Actions" column on the row.
Change "Command" from "lsphp81/bin/lsphp" to "lsphp85/bin/lsphp" and click the Save button at the top of the page.
Click the "Gracefull Restart" button at the top of the page.
To confirm PHP was updated, in a web browser, go to https://<your URL>/wp-admin and log in.
Go to "Tools" -> "Site Health".
Click on the "Info" tab and expand "Server".
"PHP version" should now be updated to 8.5.12.
First, Login to the Google Cloud and SSH into your VM.
Install the new PHP version:
sudo apt-get install lsphp85 lsphp85-common lsphp85-curl lsphp85-mysql lsphp85-imap lsphp85-redis lsphp85-intl. I also needed to configure the login and open the port for the OpenLiteSpeed WebAdmin Console even though the port was already added to the Google Cloud firewall:
Code:
sudo ufw allow 7080/tcp
sudo ufw reload
sudo /usr/local/lsws/admin/misc/admpass.sh
Go to Server Configuration -> External App.
Click the Edit button under the "Actions" column on the row.
Change "Command" from "lsphp81/bin/lsphp" to "lsphp85/bin/lsphp" and click the Save button at the top of the page.
Click the "Gracefull Restart" button at the top of the page.
To confirm PHP was updated, in a web browser, go to https://<your URL>/wp-admin and log in.
Go to "Tools" -> "Site Health".
Click on the "Info" tab and expand "Server".
"PHP version" should now be updated to 8.5.12.