You are here: Bizarre phantom bug (Calling a PHP script from an Apache "Action" directive) « PHP Programming Language « IT news, forums, messages
Bizarre phantom bug (Calling a PHP script from an Apache "Action" directive)

Posted by Adam Atlas on 11/25/05 09:06

(Apache/2.0.55, PHP/4.4.1)
I am using an "Action" directive in my Apache configuration to map a
certain file type (by means of AddType and AddHandler) to a PHP script.
I wasn't sure if this would work, since the Apache docs say the Action
directive is for mapping a handler name to a CGI script in particular.
But it seemed to work at first.

Then a mysterious bug arose: Sometimes it works perfectly, and other
times the output is a totally blank page. It seems that if I haven't
viewed a page for a while, it chooses to do one of these at random
(though it is blank more often than not), and then it persists in the
same behaviour until I reload it many times. (That is, usually a page
appearing blank will eventually display if I reload it many times;
however, only rarely will a correctly-displayed page regress to
appearing blank after reloads.) Checking with `curl -i', it would
appear to a client program that the request was perfectly successful:
all the headers are there (with the correct content-type), it has an
HTTP/1.1 200 OK line, and so on (and there's nothing unusual in the
server's access or error logs), except Content-length is 0, and there
is indeed no content at all after the two newlines.

WTF?? Since when do computers behave non-deterministically? I should
hope, if a program is not going to behave correctly, that it at least
do so predictably and consistently. That would make debugging it much
easier. But what am I to make of this Schrodinger's Bug? How do I even
approach the debugging process?

(Also, if anyone could suggest a workaround, an alternate method of
having a PHP script handle files with a certain extension, then that
would be just as welcome. Though I'd like to stay within mod_php,
avoiding a CGI-based technique, because I'd prefer to not start a
process every time these pages are requested.)

Thanks.
-- Adam Atlas

 

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

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