473,507 Members | 2,375 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Bizarre phantom bug (Calling a PHP script from an Apache "Action" directive)

(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

Nov 25 '05 #1
1 1922
It's unclear from your message whether your flaky page delivery issue
arises from the resultant page being cached or the page being corrupt
(or something else), but two ideas follow. In any case, I suggest you
put manual logging into the actual .php file used to generate the
returned page (so that you are 100% certain it is being run. Just
append the date/time and any miscellaneous stats to a fixed file).
Secondly, as far as preventing cacheing of the pages, I have a little
discussion of possible headers to be aware of at
http://at.php.net/imagecreatefrompng

Csaba Gabor from Vienna
Adam Atlas wrote:
(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


Nov 26 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
11421
by: Sylvie Stone | last post by:
Hi group - I have an html form for that uses username and password to login to a specific area of the website. The "area" the user wants to go to is based on a pull down menu. Becasue the...
4
13731
by: KathyB | last post by:
I have the following script in an html page: function goToPosition() { varGoTo = document.write(document.cookie("Position")); document.scrollTo(0, varGoTo); } </head> <body...
3
4347
by: Zhidian Du | last post by:
I am using java to write to url, http://fatigo.bioinfo.cnio.es/ , but I found the form is : <form method="post" action="/" enctype="multipart/form-data" name="fatigo"> I have no idea why...
2
1429
by: Don | last post by:
Can someone tell me what I'm doing wrong here. I can't believe I'm having this kind of problem. Think maybe I've been working on this for too long, and everything is starting to look the same. ...
1
1969
by: tnhoe | last post by:
Hi, <Form method='post' action="next.htm?btn="+"this.myform.myobj.value"> What is the correct syntax for above ? Regards Hoe
1
6725
by: RC | last post by:
If I want to explicitly save the record before executing a Close action. Which of the following should I use? Or does it depend on whether it is based on a Form or something else? If Me.Dirty...
0
2546
by: Joeyej | last post by:
Hi - I'm trying to move/use a web form (containing some javascript field checks) previously hosted on a Windows 2000 server. However, the FORM METHOD="post..." command in the form (shown below)...
18
10707
by: zoilus | last post by:
Can not determine how "<?=PHP_SELF?>" is supposed to work. The below is the line of code. <!-- <form name="search" method="post" action="<?=$PHP_SELF?>"--> When the above statement is run the...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7319
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7031
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1542
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
760
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
412
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.