flush() not flushing promptly?? PHP and Ubuntu 11.04

I have a sendMail program sending letters to people in a mailing list. After each email is composed and sent there is a one line message returned to the browser. On my old server the flush() would create a nice steady flow line by line.

I just brought up the same program on my Linode slice and for one thing the send mail is running really slow but that's not really my question. What I can't live with is that it buffers 35 lines before it sends one. I'm ok with this but there are other users of the program and I'm sure they will think something is wrong and bail before the first response from the server. In fact, I'm surprised that the browser didn't time out on the server.

Is there something I can do to configure the server or php.ini to get flush() to do it's thing?

3 Replies

Are you running nginx by any chance? So far as I know flush doesn't work with nginx since it has it's own buffers.

No, NGINX is not running on my slice.

@rebrunius:

No, NGINX is not running on my slice.
Surely you mean nginx is not running on my single instance non-rackspace Linode Cloud… :twisted:

More seriously, have you checked http://php.net/manual/en/function.flush.php ??

Seems many things can cause flush to not flush.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct