Reply to Re: Want headers sent NOW. How to make PHP send them?

Your name:

Reply:


Posted by Chapman Flack on 10/06/05 16:29

I wrote:
> In another language, the right way to do it would be to exec(2)
> - pcntl_exec in PHP speak - the filter, with the open file
> dup'd on its standard input. exec /replaces/ PHP with the
> filter, so if PHP hasn't written the headers by then, it never
> will.

ECRIA Public Mail Buffer wrote:
> A fallacious assertion. Once your command is run, your
> PHP script proceeds with execution. It does not die as
> a result of the call to exec().

You might look again at what I wrote. You'll see I was
describing what would be the obvious, efficient solution in a
language other than PHP, involving the POSIX exec(2), which is
not what PHP calls "exec" but rather what PHP calls "pcntl_exec."
If you are not familiar with the effects of pcntl_exec, you will
be able to find it in section CVI of the PHP manual.

The point of my post was to find out if there is any way in PHP
to implement the same efficient solution, without an extra fork
and without a race condition. It still appears that there isn't,
but if the extra process creation is tolerable, it turns out the
race condition can be avoided by using an undocumented feature of
proc_open, found in the source ext/standard/exec.c and now noted
on the proc_open manual page.

I understand how you might have thought I was off the mark if
you read the posting too quickly and thought I was talking about
what PHP calls "exec." By and large, it never hurts to give
something a closer second reading, if you find yourself about
to call it "fallacious."

[Back to original 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

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