In article [EMAIL PROTECTED], Robert McPeak
[EMAIL PROTECTED] wrote:
I have other situations where I would like to somehow spawn a new php
process so that the page loads quickly and my user doesn't get frustrated or
confused.
Hang on, there's lots of talking around the point here. This is not
I'm interested in spawing a new PHP process -- if that's the correct terminology.
The situation is that I've got a very slow loading page, where, for example, I'm using
PHP to send, say, 1000 emails. The user clicks submit, and, although PHP is firing
out the emails, it appears to the user
The correct solution for this particular problem is to just queue the
outbound mail and have your MTA deliver them out of band. man sendmail
-Rasmus
On Tue, 26 Nov 2002, ROBERT MCPEAK wrote:
I'm interested in spawing a new PHP process -- if that's the correct terminology.
The situation is
Assuming you're working on UNIX--you need to use one of the execute
functions (search for exec in the manual). You can spawn a separate PHP
in the background in a number of way, for example, by using the screen
program.
If I remember correctly, you can't instantiate it directly and run it in
the
Have your page before the email's would actually be sent, submit to a
page with a frameset, in the bottom frame have a height of 1 pixel so
that it's invisible. Then, in your PHP page, add something like:
script language=javascript
parent.topframe.progress.value =
Rasmus,
Thanks for you reply. I agree that what you suggest is the correct solution for the
mail delivery scenario I used as an example.
My example was poor in that in limited the scope of what I was asking.
I have other situations where I would like to somehow spawn a new php process so
Usually the best solution is to use whatever backend you are talking to
correctly. For a long-running MySQL query, for example, you should have a
look at the non-blocking mysql_unbuffered_query() call.
There is a fork() function in the pcntl extension and there is also a very
experimental thread
7 matches
Mail list logo