I am trying to create a PHP WebUI for a "C" program but I have problems with the exec() function. This is a part of my code :
exec("python conv.py");
exec("mpirun -np <x> <prog> -- <args>");
exec("python disp.py);
While the "python programs" are executed and work fine, I cannot execute the "mpirun -np <x> <prog> -- <args>" command. <x> is a number, <prog> is my executable and I may have up to four-five <args>. The "mpirun.." command reads a file created by "python conv.py", processes it and then writes a new file which is passed to "python disp.py". I have set the rights of the folder to 777 so writing is allowed.
Things I've tried :
a) Use "system()" or "shell_exec()" commands
b) Make "mpirun -np <x> <prog> -- <args>" bash script and call it using "exec(sh <script>)"
c) Try to call the program without "-- <args>"
d) Try to call it using "exec("/usr/bin/mpirun ...");
e) Make a symlink of "/usr/bin/mpirun" to the directory where my PHP page is in.
f) Execute a simple "C" "hello" program "exec("./hello")". This worked so I believe that the other shoud work also.
g) safe_mode is off in php.ini
I can execute the command from shell as a simple user so I guess it is not a matter of rights/ownership.
Any ideas? I am using a "debian-based" distro, PHP 4.4.7, Apache 2.0.59.
Thanks in advance.