attempting to run a shell script using PHP. the shell script contains:
'cd /data/nfsshare; python /data/nfsshare/kron_hull.py> /data/nfsshare/log.txt'
that is running a python script named kron_hull.py
the php code im using is:
if ($_POST['visual']) {
shell_exec("sh test.sh");
echo "working! woot woot";
} else {
echo "not working";
}
i am using the echo's as a way to tell if its running the if statement correctly, and i am able to successfully echo "working! woot woot", but the shell file does not run, because the script is meant to create a new file on the server, which it does not.
the shell file works when you put it directly in the linux terminal as "sh test.sh" so the issue is not with the shell file.
i also ran shell_exec('whoami');
and shell_exec('ls -lart');
and was able to echo both of those, so i don't believe it is a problem with the shell_exec() command.
my problem is: i dont believe the shell script is even running when put into the shell_exec() command, and I dont know a better way to check besides looking for the new file its supposed to create, which i get none.
any help is appreciated, if you need me to do anything for testing, or need more information, lmk and ill be glad to answer.
i checked the related questions and they did not help my case