Re: exec() or system() to run *.exe and let php continue with code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Hi all im new to PHP and im trying to let a process (*.exe file) to run in
> background(localhost) and let php continue processing the script. But PHP
> always stops and wait for the (*.exe) stops/close!
> 
> Anyone here can help me by giving me an simply example to let PHP run the
> exe file and continue with code execution.


check out http://us2.php.net/manual/en/function.exec.php
read through the user comments
found this on php.net

function execInBackground($path, $exe, $args = "") {
   global $conf;
  
   if (file_exists($path . $exe)) {
       chdir($path);
       if (substr(php_uname(), 0, 7) == "Windows"){
           pclose(popen("start \"bla\" \"" . $exe . "\" " .
escapeshellarg($args), "r"));
       } else {
           exec("./" . $exe . " " . escapeshellarg($args) . " >
/dev/null &");
       }
   }
}

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux