Page 1 of 1

PHP Threads

Posted: Mon Feb 12, 2007 12:41 am
by sakthi
hi everybody,

i created a script that works as a E-mail listener. it will receives the e-mails and process on it.
Then it will generate some reply e-mail notifications. Then it will send those replies to the end user.

Now it will work when i request that script from the browser.(i.e, 127.0.0.1/email_listener.php).

but i want to do it by a thread work. means that, it should work from the server automatically, whenever the server starts it should start and should work as listener.

i think it can be achieved by some thread concept. is it there in PHP?

could you please help me?

Posted: Mon Feb 12, 2007 3:30 am
by Kieran Huggins
while there is forking in PHP... it would be much easier to use cron

Posted: Mon Feb 12, 2007 3:39 pm
by Weirdan
why not start it from inetd?

Posted: Wed Feb 14, 2007 4:21 am
by sakthi
hi, thanks a lot.

i can execute the script timely using the cron.

i want to run the script forever. how it is possible?

if i set minutes field 1 - 59, will it work? :cry:

Posted: Wed Feb 14, 2007 7:42 am
by feyd
If it's running forever you effectively have a hung process. Just stick with cron.