I'm trying to run a script from my PHP file. When I run the script, it just opens my notepad instead of executing the file.
I have given my folder read and write permissions, tried to run via SSH (because I work with Vagrant) and via cmd. But nothing seems to work. I think my code is correct, which you can find bellow:
$output = shell_exec(getcwd()."/scripts/row.sh 2>&1");
Someone who can help me out?
2>&1can be used under that system? Also might be worth exploring what "default application" is registered inside the system to handle "*.sh" files.2>&1seemed to work the last time I checked. Without the2>&1it opens a notepad aswell. I'll have a look at the windows .sh handler2>&1works with both windows (cmd) & linux (*sh)