I am working on a web based project that executes a program on the server called MAFFT. MAFFT takes as arguments an input file and a file to write the output to.
mafft in > out
I have a php page that calls this:
<?php
shell_exec("mafft in > out);
?>
I have also tried a shell script (scr.sh):
#!/bin/bash
mafft in > out
Then:
<?php
shell_exec("sh ./scr.sh");
?>
When I run either the shell script or the php file from the command line
php something.php
it works exactly as it is supposed to, but when I just navigate to the page in a web browser, it creates the out file but does not write to it (even if I change the output file perm to 777).
The in/out files can be pretty large since this is sequence alignment stuff, but I am testing with less than 200 character files.
Is there something that I am missing here or is it just not possible to do this from a web page?
Thanks,
Ryan