473,657 Members | 2,540 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-deterministical ly? 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 1941
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-deterministical ly? 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
11432
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 user/password info is in differnet databases, how can I call different validation scripts based on this input ? THANK YOU! See below please. Somethinglike this:
4
13750
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 onload="goToPosition()">
3
4357
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 the action is not a URL, can you explain it why. Thanks.
2
1441
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. I'm trying to use JS on a client-side page to prefill "action" of a <form> tag. Here's what I'm using: document.forms.action.value = "http://..." Can someone please give me a hand with this.
1
1990
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
6777
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 Then RunCommand acCmdSaveRecord End If DoCmd.Close or
0
2552
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) now renders "Page not Found" when launched on the new Windows 2003 server (ws-server1). The form is designed to use the write.asp program to write to an Acccess database and is successful on any Windows 2000 server. This is frustrating because...
18
10736
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 following is the result. You don't have permission to access /dev/forms/forms_testing/< on this server.
0
8425
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8326
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8845
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8743
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8622
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4173
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4333
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2745
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 we have to send another system
2
1736
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.