大网数据广告活动
网站运营与故障问答

I'm using PHP 7.1 but Hostgator says they are on 5.4, and Cron throws an error

· 52CE 我爱测

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 hi…

问题原文

原帖链接 · JVC · CC BY-SA 4.0

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?

已采纳解答

原帖链接 · JVC · CC BY-SA 4.0

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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2020-01-04)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。