enuro12 Posted April 17, 2011 Share Posted April 17, 2011 I want to start my executable via exec. (or system or anything else really) But once the shell based server starts (which stays running) the php just stays going waiting on the process to complete. Can i start the app without having to wait on it to complete? <? shell_exec("c:\\server\\server\webstart.cmd"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/233935-another-shell_exe-question/ Share on other sites More sharing options...
enuro12 Posted April 17, 2011 Author Share Posted April 17, 2011 As a note. I've tried the system() recommended on php.net/manual In my case webstart.cmd starts a second .bat file (which actually calls a 3rd) From WIDOWS to start multilpe php scripts from a parent script and do not wait for child scripts to finish, from the parent.php creat a X.bat file that contains all the commands to start child objects, something like: start /B C:/[path_to_php]/php -f C:/child1.php > C:/[path_to_log1].txt start /B C:/[path_to_php]/php -f C:/child2.php > C:/[path_to_log2].txt and then run the X.bat width <?php system("CMD /C X.bat"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/233935-another-shell_exe-question/#findComment-1202466 Share on other sites More sharing options...
trq Posted April 17, 2011 Share Posted April 17, 2011 You'll have to background the process. Nothing to do with PHP. In Linux you would append & to the end of the command, Windows, I have no idea but I'm sure if you Google it you will find it. Quote Link to comment https://forums.phpfreaks.com/topic/233935-another-shell_exe-question/#findComment-1202479 Share on other sites More sharing options...
enuro12 Posted April 17, 2011 Author Share Posted April 17, 2011 You'll have to background the process. Nothing to do with PHP. In Linux you would append & to the end of the command, Windows, I have no idea but I'm sure if you Google it you will find it. I've been googling for 5 hours. I saw all the resluts for exec in google so i joined and posted my question. I'm on a windows os. The linux command is exec("bla bla bla &") but that defiantly doesn't work for windows. I just got done trying system(php c:\script2.php) But that too waits on the process to complete. Quote Link to comment https://forums.phpfreaks.com/topic/233935-another-shell_exe-question/#findComment-1202486 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.