Stream_get_contents()无法与Cron Job一起使用

时间:2019-05-31 18:03:38

标签: php cron

我的主机中有一个名为var frArray = res[0].friendRequests.split('|'); frArray.splice(frArray.indexOf(data.friend), 1); // <-- no assignment console.log(frArray); “ public_html”的脚本(有关脚本内容,请参见下文)。 cronjob每分钟执行一次“ index.php”文件。

index.php

问题是每次使用cronjob执行“ index.php”时,$handle = fopen('example.com', 'r'); $source= stream_get_contents($handle); echo $source; fclose($handle); 都将是”(一个空字符串)!

但是当我使用Firefox手动执行$source并刷新其标签时,index.php将是一个包含example.com的html源代码的字符串

我的虚拟主机或其他地方是否有任何限制设置,从而阻止$source记录网站信息?

0 个答案:

没有答案
相关问题