2

Trying to make sense of this. Doing a quick phpinfo() I get:

PHP Version 7.1.14
System  Linux gatorxxxxx.hostgator.com n.nn.nnn-nnn.nnn.nnn.x86_64 #1 SMP Tue May 21 13:24:40 CDT 2019 x86_64

But when I try to install a cron that hits a URL every 30 days for the Auto-Install-free-SSL plugin that I've been using for years on a different host, cron reports:

Your server is running PHP version 5.4.45 but WordPress 5.3.2 requires at least 5.6.20.

Got Hostgator on the phone and they reported that all shared hosts are still on 5.4.x which fits the error message, but if phpinfo() is showing I'm on 7.1... what the heck is actually going on here? How can I get cron to also use 7.1 so the command will execute?

  • It's possible that you have a directive in .htaccess (and/or set through your hosting control panel) that sets a different PHP version to something other than the default (5.4) as set on your server. – DocRoot Jan 5 at 18:39
  • Yes that is possible, but it's not the case here. I just had to tell cron what to use since for some reason it always defaults to the lowest version of PHP on the server. – JVC Jan 5 at 18:40
2

I have discovered that you can specify the version of PHP that cron should use like so:

/opt/php56/bin/php -q /home/userna5/public_html/testcron.php

thanks to this tutorial. All is now working as desired.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.