Need help Api addcron not work (port 2082)
if i run code. it doesn't add cron to cpanel.
port 2082 can using api ?
(i don"t speak very good english, I m thai ^_^)
include("xmlapi.php");
$ip = " ";
$cpuser = " ";
$cppass = " ";
$xmlapi = new xmlapi($ip);
$xmlapi->set_port(2082);
$xmlapi->password_auth($cpuser,$cppass);
$xmlapi->set_debug(1);
$args = array('php /home/myuser/public_html/CronTask.php >/dev/null 2>&1','*','*', '*', '*','*');
$xmlapi->api2_query($cpuser, 'Cron','add_line', $args);
-
Hello, The $args array needs to be an associative array with the argument names like so: $args = array('command' => 'php /home/myuser/public_html/CronTask.php >/dev/null 2>&1', 'day' => '*', 'hour' => '*', 'minute' -> '*', 'month' => '*', 'weekday' => '*' );
0
Please sign in to leave a comment.
Comments
1 comment