使用PHP在phpvibe中传递参数cron job file execute命令

使用PHP在phpvibe中传递参数cron job file execute命令,php,cron,jobs,phpvibe,Php,Cron,Jobs,Phpvibe,我们有如下的源文件: $binpath = get_option('binpath', '/usr/bin/php'); $command = $binpath . ABSPATH . "/videocron-premium.php plan_id='$plan_id'"; exec("$command > /dev/null &", $arrOutput); 要将参数发送到此文件的 这是我的文件的一部分: parse_str($argv[

我们有如下的源文件:

$binpath = get_option('binpath', '/usr/bin/php');
$command = $binpath . ABSPATH . "/videocron-premium.php plan_id='$plan_id'";
exec("$command > /dev/null &", $arrOutput);
要将参数发送到此文件的

这是我的文件的一部分:

parse_str($argv[1], $params);
$plan_id = $params['plan_id'];
我想在这个php cron文件中获取参数

这对我没用


如何解析$argv并继续我的算法

您可以使用此代码获取计划id

foreach ($argv as $arg) {
if (stripos($arg, "plan_id") !== false) {
    $plan_id = substr($arg, 8);
}
}

因此,
parse_str($argv[1],$params)不起作用?是的,它在linux cron上对我起作用了,谢谢。我们如何在cron作业中跟踪代码?