I have this script that works correctly (if run via terminal manually)
#!/bin/sh
unset DISPLAY
scriptname=$1
[ -f "$scriptname" ] && scriptname=$(winepath -w "$scriptname")
wine "C:\Program Files (x86)\Inno Setup 5\ISCC.exe" "$scriptname" "/q"
Ubuntu Server with Apache, PHP
Wine installed with Inno Setup 5 in folder Program Files (x86)
ISS File: "/home/www/files/iss/Example.iss"
Script SH: "/home/www/iscc.sh"
1a - If I access the terminal via SSH and run the file "iscc.sh" passing the file location. "Iss" as a parameter, the build is done correctly without problems.
2a - If I run all the commands in a single line (inline), the compilation is also done correctly without problems.
1b - "/home/www/iscc.sh" "/home/www/files/iss/Example.iss"
2b - unset DISPLAY && scriptname="/home/www/files/iss/Example.iss" && [ -f "$scriptname" ] && scriptname=$(winepath -w "$scriptname") && wine "C:\Program Files (x86)\Inno Setup 5\ISCC.exe" "$scriptname" "/q"
But the problem is the following, via PHP, if I use the command shell_exec or exec or system, none of them run properly.
What can be causing these failures, can someone help me with this problem? I do not understand why not compile.