I am trying to register user on ejabberd linux server.
I am using below php code
<?php
$username = 'hello';
$password = 'hello';
$node = 'my ip';
exec('sudo -S ejabberd /usr/sbin/ejabberdctl register '.$username.' '.$node.' '.$password.' 2>&1',$output,$status);
if($output == 0){
// Success!
echo 'success';
}else{
// Failure, $output has the details
echo '<pre>';
foreach($output as $o){
echo $o."\n";
}
echo '</pre>';
}
?>
But when I execute the file i got following error :
sudo: /etc/sudoers.d is world writable
[sudo] password for daemon:
Also I found the solution from below url
but I am not getting how to use this
Please help