I would like my script to make a call to a host stored program. The program is one which I have written can compiled and runs fine from the command line. However, when passed through the system() call, I get nothing back. The relevant portion of code looks like this:
I have put the executable in many different locations (thinking that I was having a problem with symbolic links or something like that). I have also tried giving it the full path to where it is stored. I have had no luck.
I can, however, set $command = "ls" and get a directory list like I would expect. The file permissions on the executable should be 777 at this point to allow any and all access.
Furthermore, I have not been able to get any useful error feedback to the web browser. I would like to see what error message is being display (i.e. No file exists, permission denied, etc.) I get no output from the file, nor is a file created that should be done by the executable. The return code that I receive ($return_val) is an 11, which is not produced by my program.
Any help would be greatly appreciated.
Code:
if ($generate)
{
$command = "myexecutable";
echo system($command, $return_val) . "<br>";
echo $return_val;
}
I have put the executable in many different locations (thinking that I was having a problem with symbolic links or something like that). I have also tried giving it the full path to where it is stored. I have had no luck.
I can, however, set $command = "ls" and get a directory list like I would expect. The file permissions on the executable should be 777 at this point to allow any and all access.
Furthermore, I have not been able to get any useful error feedback to the web browser. I would like to see what error message is being display (i.e. No file exists, permission denied, etc.) I get no output from the file, nor is a file created that should be done by the executable. The return code that I receive ($return_val) is an 11, which is not produced by my program.
Any help would be greatly appreciated.