I'm trying to run a command from PHP to disconnect a user from OpenVPN Access Server
$output = shell_exec('sacli --user test --client_reason EXPIRED DisconnectUser');
echo "<pre>$output</pre>";
This won't work and doesn't disconnect user, I confirmed the full command works in the terminal.
If I just use shell_exec('sacli'); or shell_exec('sacli --help'); it will echo successfully:
sacli: No command specified
Use --help to show usage
Looks like is throwing this in Apache logs when using shell_exec with options:
ERROR: [Errno 2] No such file or directory: 'out/tmp-2OtTHkYbGxPA.tmp': util/options:501,sagent/sacli:516,util/file:165,util/file:159,util/file:151,util/simplefile:9 (FileNotFoundError)
Any help is appreciated,
Thanks!