I am trying to make a bash script on my server to clear the Grav cache. When I run it from the server, it works fine. But when I run it from my local machine, over SSH, I get an error: You are running PHP 5.6.36, but Grav needs at least PHP 7.1.3 to run
. However, php -v
on my server returns PHP 7.2.11 (cli)
and on my local machine returns PHP 7.1.23 (cli)
. I do not begin to understand what the problem might be.
In the end, I could not resolve the issue of the different PHP versions, but solved the problem by including the path to the correct PHP version in the server script. So, locally I have ssh jeremygrav@ps589716.dreamhostps.com "bash ./clear.sh"
and on the server, the script contains /usr/local/php73/bin/php bin/grav cache --all
.
That works fine, although I realise it avoids the problem rather than solving it.