i am trying to run the following csf command from inside a php script:
$ipNbr = 22.214.171.124 ; // for example
$csfCommand = ‘sudo /usr/sbin/csf --tempdeny ’ . $ipNbr . ’ 3600;’ ;
$csfResult = shell_exec($csfCommand) ;
$csfResult = exec($csfCommand) ; // i also tried exec rather than shell_exec
so far this does not do anything at all, including returning any sort of error/diagnostic message. inside my log file, i do see:
[Fri Nov 20 13:28:13 2015] [error] [client 126.96.36.199] sh: /usr/sbin/csf: Permission denied
i placed the following line inside of visudo:
marksdomain.com ALL=(ALL) NOPASSWD: /usr/sbin/csf
i have tried every combination i can think of:
/bin/sudo /usr/sbin/csf . . . .
sudo /usr/sbin/csf . . . .
/usr/sbin/csf . . . .
csf . . . .
any ideas how i can fire off the csf command from inside the php script ??
thank you all very much.