Re: bg execution
| From: | Martin Geisler | Date: | Sat, 22 May 2004 19:41:20 +0000 |
| Subject: | Re: bg execution | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-186766@lists.php.net to get a copy of this message | ||
mart@bang.ca (Martin Helie) writes:
> Hello,
>
> I need to start a php-based socket server that doesn't die if the client
> closes their browser window.
>
> Is there another (maybe cleaner) method to accomplish this, other than
>
> exec('bash -c "exec nohup setsid php server.php > /dev/null 2>&1
> &"');
I haven't had a need for something like this myself, but I think the
ignore_user_abourt() function is what you need:
http://php.net/manual/en/function.ignore-user-abort.php
--
Martin Geisler My GnuPG Key: 0xF7F6B57B
PHP EXIF Library | PhpWeather | PhpShell
http://pel.sf.net/ | http://phpweather.net/ | http://gimpster.com/
Read/write EXIF data | Show current weather | A shell in a browser