PHP coding

ello,
I am running linux apache and php.
I have an external programme called sfse and I would like to execute it remotely. The command I would like to execute is the following

/bin/sfse 12 13 15 (executing the command with three parameters) 12,13,15.

My main problem is that even if I try exec, passthru,shell_exec I receive as a status 1 and I never get any output. I would like
A. to have the command executed and
B. receive the output. (perhaps the command might fail so I would like to receive the output of the failed message, like syntax error, or one parameter is missing).

The Code is:
$command=$AllTogether;
$output=passthru($command);
or
$output=exec($command,$output,$status);
or
using shell exec.

For me it seems to be more a safety problem. The command requires root permissions so even though i Used visudo I could not get any reply.

Just to mention that safe mode is disabled.
This is my phpinfo()
Configuration PHP Core Direc - Anonymous - T6x1NVd0 - Pastebin.com

P.S I know that exeuting external programmes is a security hazard but this application is only running on a local network with no access to the internet.

I would like to thank you in advance for your help.
Best Regards
Alex
alaios is online now Add to alaios’s Reputation Report Post Edit/Delete Message

Status 1 means the command exited with error. Since you say it requires root permission, you have to run it with sudo. So the command has to become

/usr/bin/sudo /bin/sfse 12 13 15

and you have to allow the wwwrun account to run it as root by using visudo to put such a rule into /etc/sudoers.

Thanks! visudo fixed that
!