I am running the WordPress multisite click to deploy on the compute engine.
Operating system
Debian 9.8
Package contents
Apache 2.4.25
Google-Fluentd 1.6.9
MySQL-Client 5.7.26
MySQL-Server 5.7.26
PHP 7.0.33
Stackdriver-Agent 5.5.2
WP-CLI 2.2.0
WordPress 5.1.1
phpMyAdmin 4.6.6
I would like to upgrade PHP to 7.3
4
Answers
You can use a third-party repository to install php7.3
You may follow this instructions on how to update your php version from 7.0 to 7.3.
For Debian:
For Ubuntu:
If you encounter the error below during installation, you may execute the command "
$ sudo rm /var/lib/dpkg/lock
" then try installing the php7.3 again.Hope this information helps.
After updating your php version, the other thing you should do is:
update MYSQL and get WordPress to to recognize the new version
sudo apt-get update
sudo apt-get install php7.3-mysql
sudo a2enmod php7.3
sudo a2dismod php7.0
sudo systemctl restart apache2
This comprehensive instruction works just fine https://www.jiyuulife.net/update-php-version-for-wordpress-on-debian-9/
In the commands, replace the instruction’s PHP version (7.4.5) with the latest release (7.4.11 as of October 2020).
In my case, after the update WordPress alerted me about missing (PHP) extensions that some plugins needed. I added them separately as per the instruction, restarted Apache and everything panned out perfectly fine.
Magic!
Thanks Tang for the great instruction.