Question

I updated PHP but Wordpress doesn't recognize it

  • Posted April 3, 2020
  • PHP

I get this by typing php -v:

PHP 7.4.4 (cli) (built: Mar 20 2020 13:47:17) ( NTS ) Copyright © The PHP Group Zend Engine v3.4.0, Copyright © Zend Technologies with Zend OPcache v7.4.4, Copyright ©, by Zend Technologies

Wordpress says:

Your site is running an older version of PHP (7.0.33-26+ubuntu16.04.1+deb.sury.org+1)

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Where is the vhost configuration file located? I’ll look into this but it looks a bit complicated to me. Could you say what exactly I need to do to fix this.

Hi @rem3n,

Most probably you have multiple PHP versions on your droplet and your website is using another one.

What I’ll recommend doing in order to confirm this is, SSH to your droplet

ssh root@DropletIp

Go to your website’s DocumentRoot

cd /path/to/website

create an info.php file there like so

touch info.php

As soon as you have created it add the following content

<?php phpinfo();

Save the file and load it in the browser, there you should be able to see the full php PATH of our application. Most probably you are using the default one located

/usr/bin/php

You’ll need to change it to use the newest PHP version you have installed by chaning the path in your vhost configuration file.

Regards, KDSys