Jump to content

Another Shell_exe question


enuro12

Recommended Posts

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");

 

 

?>

 

Link to comment
https://forums.phpfreaks.com/topic/233935-another-shell_exe-question/
Share on other sites

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");
?>

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.