Hello,

I'm using the following code to get cron list but it returns a blank page and when I change port 2087 to 2083 it returns {"data":{"reason":"Access denied","result":"0"},"type":"text"} with 403 HTTP status. Anyone to help me find the issue?


PHP Code:
$user $_ENV['REMOTE_USER'] ? $_ENV['REMOTE_USER'] : 'root';
                
$accessHash $this->getLocalAccessHash();
                if(
$accessHash === FALSE) return FALSE;
                
                
$url "https://127.0.0.1:2087/json-api/cpanel?user=$user&cpanel_jsonapi_module=Cron&cpanel_jsonapi_func=listcron&cpanel_jsonapi_version=2";
                
$ch curl_init();
                
curl_setopt($chCURLOPT_VERBOSE1);
                if(
$fp fopen('curl_http.txt'"wa")) curl_setopt($chCURLOPT_STDERR$fp);
                
curl_setopt($chCURLOPT_URL$url);
                
curl_setopt($chCURLOPT_SSL_VERIFYHOST0);
                
curl_setopt($chCURLOPT_SSL_VERIFYPEER0);
                
curl_setopt($chCURLOPT_RETURNTRANSFERTRUE);
                
//curl_setopt($ch, CURLOPT_POST, 1);
                
curl_setopt($chCURLOPT_HTTPHEADER, array("Authorization: WHM $user:$accessHash"));
                
$cronlistJSON curl_exec($ch);
                
$ci curl_getinfo($ch);
                
curl_close($ch);
                if(
$fpfclose($fp);
                
                
print_r($ci);
                die(
$cronlistJSON); 
Thx for helping,

Stephane