ID: 22508 User updated by: jim at bluedojo dot com Reported By: jim at bluedojo dot com -Status: Closed +Status: Open Bug Type: *Directory/Filesystem functions Operating System: Windows PHP Version: 4.3.1 New Comment:
I also wanted to note that in version PHP 4.2.3 fopen will not work if it redirects from http:// to https://. Perhaps it should return false in this case. Previous Comments: ------------------------------------------------------------------------ [2003-03-02 16:47:12] [EMAIL PROTECTED] This bug has been fixed in CVS. In case this was a PHP problem, snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites in short time. Thank you for the report, and for helping us make PHP better. ------------------------------------------------------------------------ [2003-03-02 16:25:55] jim at bluedojo dot com 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 this bug report at http://bugs.php.net/?id=22508&edit=1