Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/loops/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
启动多个php页面/程序_Php_Cron_Automation - Fatal编程技术网

启动多个php页面/程序

启动多个php页面/程序,php,cron,automation,Php,Cron,Automation,我需要能够发射了几个php页面启动了一个cron作业 目前,我可以通过cron作业调用一个php页面来启动第一个,该页面只有: <?php file_get_contents("http://whatever.com/.../sandbox/message_launcher.php"); ?> 等等?我需要每5分钟做10次 感谢你提出的任何简单的想法。我走得有点太远了 短暂性脑缺血发作 Stve 大家好,我仍然在Stackoverflow上找到我的方法,但这似乎是发布解决方案的

我需要能够发射了几个php页面启动了一个cron作业

目前,我可以通过cron作业调用一个php页面来启动第一个,该页面只有:

<?php

file_get_contents("http://whatever.com/.../sandbox/message_launcher.php");

?>
等等?我需要每5分钟做10次

感谢你提出的任何简单的想法。我走得有点太远了

短暂性脑缺血发作 Stve

大家好,我仍然在Stackoverflow上找到我的方法,但这似乎是发布解决方案的最佳方式

我做了五个连续的文件获取内容,所有的工作都很好。然而,我怀疑,如果我们在1号文件中遇到错误,那么它将停止在那里。这对于早期的alpha来说很好,但我很确定它并不健壮

这是一个godaddy cheapo Linux托管计划,您只能在每五分钟的cron点启动一个简单的页面调用


但正如我所说的,它目前运行良好。

您可以编写一个循环,并替换URL的特定部分。在cron作业中使用
wget
调用该URL如何<代码>wget-O--q-t1hxxp://whatever.tld/.../user01/message_launcher.php您还可以使用循环或其他方式将许多
wget
调用包装到bash脚本中。(我想我们谈论的是linux服务器。)这会更好,因为您不必为这么简单的任务调用PHP。它不会回答您的问题,但会为您提供更有效的解决方案。
file_get_contents("hxxp://whatever.tld/.../user01/message_launcher.php");
file_get_contents("hxxp://whatever.tld/.../user02/message_launcher.php");