I have been trying to update PHP on my install of WordPress on Google Cloud.
I have followed these instructions: How do I upgrade from PHP 7.0 to 7.3 on google cloud platform?.
When I do a php -v
command, it shows that it is updated, but within WordPress it is still showing version 7.0, not the updated version.
2
Answers
Your system appears to have two installations of PHP. One for the CLI and another Apache or you have not restarted Apache after the update. First restart Apache and recheck.
The command to install Apache PHP is
sudo apt install libapache2-mod-php7.3
.Warning: Be careful with manual updates of PHP and other software that may have interdependencies. Make sure you have backed up your system (image) before so that you can recover is something goes wrong. Debian 4.9 is very old (obsolete) and might not be supported or even tested with the latest versions of third-party software.
The Linux command
where php
will tell you where PHP is installed. To figure out if you have a different installation for Apache, create a new web page, such asmyphpinfo.php
with the following contents. Then use your browser to view the page:Your browser will display a page like this:
Use SSH commands:
Go to root
install latest version of php
update it
install packages
check your php version
enable php7.4 and disable your current php7.0
install the libraries
restart apache