From:             jim at bluedojo dot com
Operating system: Windows
PHP version:      4.3.1
PHP Bug Type:     *Directory/Filesystem functions
Bug description:  fopen() crashes Apache if URL is redirect

The pages that is crashing my Apache server include,
"http://www.sltrib2002.com";. What is happening is fopen() is trying to
open this link but the link redirects. When this link is placed in a
browser, it actually redirects to,
"http://www.sltrib2002.com/main/index.asp";. This occurs in PHP 4.3.1. 
When I downgraded to PHP 4.2.3 fopen() worked fine.

Here is more information about the problem in detail: 

I am running WinXP, Apache 1.3, MySQL 3.23, and PHP 4.3.1. 

I have a php page called "populate.php" that is using fopen() to index web
pages. This works most of the time when I load this page in a browser, but
fopen() is causing problems. Sometimes a specific web site (that has a
redirecting link) causes Apache to crash. A window pops up saying,
"Apache.exe has encountered a problem and needs to close. We are sorry for
the inconvenience." And in the browser it says, "The page cannot be
loaded." 

Although it says it crashes, the Apache server still seems to run if I
load another page. It seems as if only that specific connection crashed.
But this is the problem. I need to find out a way so it does not crash the
page, populate.php, so it can continue running without getting the error
in the browser "The page cannot be loaded." 

I tried the same web site on another configuration of Apache (that I pay
for and am trying to avoid) and the page loads fine. Why is fopen crashing
my server if the link redirects?  Again, this occured in PHP 4.3.1.  I had
to downgrade for fopen to work ok with websites that redirect.


The code below will produce the error in PHP 4.3.1.

<?
        //The site http://www.vsacentral.com
        //redirects to
        //http://www.vsacentral.com/main.php
        //
        //Also try this
        //http://www.sltrib2002.com
        //It redirects to
        //http://www.sltrib2002.com/main/index.asp
        
        $url = "http://www.vsacentral.com";;
        if ($fd = @fopen($url,"r"))
                echo "Success";
        else
                echo "Failure";
        
        fclose($fd);
                
?>
-- 
Edit bug report at http://bugs.php.net/?id=22508&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=22508&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=22508&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=22508&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=22508&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=22508&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=22508&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=22508&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=22508&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=22508&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=22508&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22508&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=22508&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=22508&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=22508&r=gnused

Reply via email to