PHP script not working to replace WordPress cron for multi-site
Within your cron_call function, around line 200, you have this block:
//Add the url to the stack$chs[$blog_id]=curl_init();curl_setopt($chs[$blog_id], CURLOPT_URL, $cron_url);curl_setopt($chs[$blog_id], CURLOPT_HEADER, 0);curl_multi_add_handle($mh, $ch);
So first you initialize your curl handlers in the $chs
array. Then, instead of using those values, you try to add the $ch
variable to your multi handler, which is null I presume.
With proper error reporting settings and by checking the result of curl_multi_add_handle
, you could probably see that the add handle operation failed.
From the php manual:
int curl_multi_add_handle ( resource $mh , resource $ch )
Return Values
Returns 0 on success, or one of the CURLM_XXX errors code.
EDIT: maybe I was not clear enough on the solution, but you need to replace
curl_multi_add_handle($mh, $ch);
with
curl_multi_add_handle($mh, $chs[$blog_id]);