Exec Script in the background, don't wait till it finishes
| From: | Kai Renz | Date: | Fri, 14 Jan 2011 16:56:45 +0000 |
| Subject: | Exec Script in the background, don't wait till it finishes | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-310764@lists.php.net to get a copy of this message | ||
Hi there,
i'm currently working on a socket project. It consists of two scripts.
The first script (socket1.php) creates a socket on a specified port
and waits for a client to connect. If a client connects, they exchange
some informations, including a random created port. Next, the first
script calls the second script (socket2.php) with the just created
port number as a parameter.
Now here is the problem:
it all works fine, but the client can't send a quit message to socket1
because socket1.php waits until socket2.php is finished. socket2.php
is working properly, and if i connect to the new socket and quit the
connection, socket1 is working again. All i need socket1 to do is to
continue working independant of socket2.
I tried everything, from shell_exec to pcntl_exec, nothing seems to work.
regards,
Kai