Ahh no the scripts are fine now I fixed them
(i also added that fi, thanks)
I used the dos2unix command and the scripts converted the endlines and things so that linux would read them correctly. The user can execute the scripts just fine
when I run them from the commandline. (and when the script finishes (takes 2 seconds), it gives me my commandline back)
But the problem is when I have php issue the system() or exec() command to run the shellscript remotely, the php will hang because I guess it doesnt want to let go of the file.
The script isnt my problem :P This is my problem in PHP code:
#!/usr/local/bin/php
$last_line = system("nohup ".$target."/start.sh > /dev/null 2>&1 &");
I put this in the PHP code to run the start.sh shellscript.
The start.sh file WILL run, but PHP will hang and not load its page. (the user is visiting via website they logged in from, hosted on the same machine)
I have tried many different variations of it.
As a test, If I link to any file I want to execute rather than the shell.sh, it will hang as well. So its the system() code not the shellscript im 98% sure.
Thanks for your help.. I know sometimes people dont want to answer because theres a lot to read. I am very grateful. I have tried using the exec() command too and other variations of the above code but nothing works. Please help me