PHP exec() as Background Process (Windows Wampserver Environment)

后端 未结 6 1055
-上瘾入骨i
-上瘾入骨i 2020-11-27 13:07

I\'m trying to setup a php trigger file that will set off a background process. (see this question)

I\'m doing this on a Windows Wampserver environment.

So f

6条回答
  •  Happy的楠姐
    2020-11-27 13:36

    Tried to achieve the same on a Windows 2000 server with PHP 5.2.8.

    None of the solutions worked for me. PHP kept waiting for the response.

    Found the solution to be :

    $cmd = "E:\PHP_folder_path\php.exe E:\some_folder_path\backgroundProcess.php";
    pclose(popen("start /B ". $cmd, "a"));  // mode = "a" since I had some logs to edit
    

    ps : Posting the same reply to the other thread (PHP on a windows machine; Start process in background) since these 2 links helped me a lot in doing some research on this.

提交回复
热议问题