php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47617 rss feed / tag causes php script to execute twice
Submitted: 2009-03-10 22:56 UTC Modified: 2009-03-11 17:29 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: matthew dot scott dot day at gmail dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.2.9 OS: Mac OS X 10.5.5
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: matthew dot scott dot day at gmail dot com
New email:
PHP Version: OS:

 

 [2009-03-10 22:56 UTC] matthew dot scott dot day at gmail dot com
Description:
------------
While outputting rss tags directly to the browser, the php script executes twice.

Reproduce code:
---------------
<?php
header("Content-type: application/xhtml+xml");
?>

<rss version="2.0">
	<SomeData>some stuff here</SomeData>
</rss>

<?php
	$fname = '/tmp/'.microtime().'.txt';
	file_put_contents($fname, "2 files will be created when you run this code once");
?>

Expected result:
----------------
I expect only 1 file to be created in /tmp/

Actual result:
--------------
2 files are created in /tmp/

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-03-11 03:48 UTC] matthew dot scott dot day at gmail dot com
I couldn't replicate this on a windows vista machine running php 5.2.8 using internet explorer 7
 [2009-03-11 13:58 UTC] jani@php.net
Please search the bug database BEFORE you submit yet another bogus report about this.
 [2009-03-11 15:31 UTC] matthew dot scott dot day at gmail dot com
I DID search the bug database and read through each one I could find. Please why don't YOU search through the bug database before submitting a BOGUS comment. This has NOTHING to do with the other bugs listed. This is a separate bug with reproducible code if you even bothered to read it.
 [2009-03-11 15:38 UTC] matthew dot scott dot day at gmail dot com
The only other bugs submitted for my problem, is this one:

http://bugs.php.net/bug.php?id=45444

which is part of another bug submission for some rss feed that the php website is generating.

My bug has NOTHING TO DO WITH THAT.

Please READ before COMMENTING
 [2009-03-11 15:40 UTC] matthew dot scott dot day at gmail dot com
After you realize that my bug is SEPARATE from the other bugs that have to do with RSS feeds... Please change the status of this bug back to open.

I have included a very small, very easily testable code snippet, and also had 2 of my coworkers able to reproduce it on their mac os machines. Then I went home and couldn't reproduce it on a window vista machine.
 [2009-03-11 16:05 UTC] scottmac@php.net
Some browsers make subsequent requests to RSS feeds when they are detected, this is something in the browser thats causing this and has nothing to do with PHP.
 [2009-03-11 16:11 UTC] matthew dot scott dot day at gmail dot com
So you're saying that this is a firefox bug? Because it definitely causes problems to have a script execute twice.
 [2009-03-11 16:17 UTC] scottmac@php.net
Look at your web server logs, you'll see two requests being made.
 [2009-03-11 16:21 UTC] matthew dot scott dot day at gmail dot com
Yes I know. That's why I submitted this bug in the first place. Because my php script was executing twice. I would like to see this bug resolved and am willing to take it to whomever needs to resolve it because it caused me a lot of frustration : /.

That's why I was asking. Is it a problem with firefox then? Or is it a problem with Apache?

Your first response says it's a browser problem, your 2nd response implies that it's a server problem.
 [2009-03-11 17:29 UTC] scottmac@php.net
PHP is receiving two requests, so not a problem with PHP.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Dec 19 12:00:02 2025 UTC