You are here: Daemonising to continue asynchronously « PHP Programming Language « IT news, forums, messages
Daemonising to continue asynchronously

Posted by Andy Jeffries on 04/24/06 17:50

I've got a script which calls (via exec) "php myscript.php --params=here".

Within myscript.php I try to become a daemon (to continue asynchronously
from the calling script) using pcntl_fork, posix_setsid and pcntl_fork
again.

It works if I call the myscript.php from the command line (it correctly
damonises and returns immediately, carrying on processing in the
background), but when I do it through Apache (request the calling
script) it waits for the child to complete first.

Anything obvious I'm doing wrong?

I'll happily post snippets of the script here, but I'd imagine it's
something fundamental I'm missing.

Cheers,


Andy

--
Andy Jeffries MBCS CITP ZCE | gPHPEdit Lead Developer
http://www.gphpedit.org | PHP editor for Gnome 2
http://www.andyjeffries.co.uk | Personal site and photos

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация