Forum Moderators: coopster

Message Too Old, No Replies

php freezes up waiting for a exec (Background Process issues)

         

newbie_php

6:28 pm on Apr 22, 2004 (gmt 0)

10+ Year Member



Hi I am relatively new at php:

Basically I run my php file, create an output format and at the end call an exec which executes a file.
The problem is that the php does not output the html code on the screen even though the exec is at the end of the php file, it appears that it freezes up.

Is there any way to execute the background process and forget about it while continuing with my program?

exec("test.bat") -- it will take quite some time for the test.bat file to finish its work. (more then 30min)

Any help is welcomed.

jatar_k

4:50 pm on Apr 24, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld newbie_php,

I was messing around with exec and passthru and to start larger programs we had some problems executing them. We ended up using shell scripts for controlling the larger programs.

You need to find a way to call it so that it doesn't wait for it to finish. Is this a windows server?

newbie_php

11:40 pm on Apr 24, 2004 (gmt 0)

10+ Year Member



Thanks for the response jatar_k:

Yes I am using Windows server.

I haven’t tried using UNIX based server, when running shell scripts did u use exec or pass thru?

jatar_k

2:42 pm on Apr 25, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



we set them up using cron or a few are manually triggered.

There are also commands to run programs in the background though I don't know what they might be with windows.