Bug #15999 Updated: fread() hangs apache when file pointer obtained from a url parameter PHPSESSID
ID: 15999 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Feedback +Status: Open Bug Type: Session related Operating System: Linux -PHP Version: 4.1.0 +PHP Version: 4.1.0, 4.0.6 New Comment: $doc="http://myserver/docs/mydoc.html?PHPSESSID=".session_id(); It was a type mismatch, of course, sorry. Previous Comments: [2002-06-01 11:51:18] [EMAIL PROTECTED] Sorry for the long time... Here's a complete but simple example : - In httpd.conf - php_value auto_prepend_file "block.php" (block.php is in my php.ini include_path, and /var/www is my Apache DocumentRoot) open_doc.php (<--I call this one with my browser) http://http://myserver/docs/mydoc.html?PHPSESSID=".session_id(); readfile($doc); //same with $fp=fopen($doc, "r"); ?> - block.php - I can't see any infinite loop here, but I may be wrong... Whenever you don't pass the session param in the url anymore, there's "no problem" anymore, except you can't retrieve session values ! [2002-03-19 05:03:47] [EMAIL PROTECTED] What is the name of the script you have pasted? What is the content of block.html? It seems you are not calling the same script, but if block.html is calling the script pasted, it's the same. [2002-03-11 13:28:19] [EMAIL PROTECTED] Ok..let's reopen this. I have no idea what you're doing but if you're not doing what I thought you were, it might be a bug..although that auto_prepend thing makes me wonder.. Please add some example scripts and what needs to be set in php.ini / httpd.conf to reproduce this. [2002-03-11 12:38:04] [EMAIL PROTECTED] Why do you think that block.html is the same script ? Maybe my example is not very clear. But you are right, Apache behavior looks like infinite recursion. Let me explain again and more precisly : the script A (the one in the previous post) tries to open the url B ($url). Script C is auto_prepended (at fread instruction, right ?) and validate the access to the script B, with the session variable. If I don't use the PHPSESSID in the url parameter (and skip the test in the script C), the script is OK. If I use another parameter than PHPSESSID, the script A is OK. Same behavior with fgets, readfile, etc... Note that the script C is auto_prepended only in a subdirectory (containing only docs like B) by apache configuration ( php_value ) and of course scripts A and C are not on this directory. [2002-03-11 11:17:55] [EMAIL PROTECTED] You're calling the same script with that fopen() ? The behaviour is called 'infinite recursion' and yes, it will hang. Not a bug. --Jani The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/15999 -- Edit this bug report at http://bugs.php.net/?id=15999&edit=1
Bug #15999 Updated: fread() hangs apache when file pointer obtained from a url parameter PHPSESSID
ID: 15999 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Feedback Bug Type: Session related Operating System: Linux PHP Version: 4.1.0 New Comment: Sorry for the long time... Here's a complete but simple example : - In httpd.conf - php_value auto_prepend_file "block.php" (block.php is in my php.ini include_path, and /var/www is my Apache DocumentRoot) open_doc.php (<--I call this one with my browser) http://http://myserver/docs/mydoc.html?PHPSESSID=".session_id(); readfile($doc); //same with $fp=fopen($doc, "r"); ?> - block.php - I can't see any infinite loop here, but I may be wrong... Whenever you don't pass the session param in the url anymore, there's "no problem" anymore, except you can't retrieve session values ! Previous Comments: [2002-03-19 05:03:47] [EMAIL PROTECTED] What is the name of the script you have pasted? What is the content of block.html? It seems you are not calling the same script, but if block.html is calling the script pasted, it's the same. [2002-03-11 13:28:19] [EMAIL PROTECTED] Ok..let's reopen this. I have no idea what you're doing but if you're not doing what I thought you were, it might be a bug..although that auto_prepend thing makes me wonder.. Please add some example scripts and what needs to be set in php.ini / httpd.conf to reproduce this. [2002-03-11 12:38:04] [EMAIL PROTECTED] Why do you think that block.html is the same script ? Maybe my example is not very clear. But you are right, Apache behavior looks like infinite recursion. Let me explain again and more precisly : the script A (the one in the previous post) tries to open the url B ($url). Script C is auto_prepended (at fread instruction, right ?) and validate the access to the script B, with the session variable. If I don't use the PHPSESSID in the url parameter (and skip the test in the script C), the script is OK. If I use another parameter than PHPSESSID, the script A is OK. Same behavior with fgets, readfile, etc... Note that the script C is auto_prepended only in a subdirectory (containing only docs like B) by apache configuration ( php_value ) and of course scripts A and C are not on this directory. [2002-03-11 11:17:55] [EMAIL PROTECTED] You're calling the same script with that fopen() ? The behaviour is called 'infinite recursion' and yes, it will hang. Not a bug. --Jani [2002-03-11 10:48:52] [EMAIL PROTECTED] http://test/block.html?PHPSESSID=".session_id(); $fp = fopen($url, 'r'); // the file pointer semms to be valid $file = fread($fp,1048576); //hangs here ! echo $file; ?> hangs apache (1.3.x). Same with 4.0.2, 4.0.6 Linux (RH 6.2 and Debian 2.2), never on Win98. Other parameters don't have the same effect. -- Edit this bug report at http://bugs.php.net/?id=15999&edit=1
Bug #15999 Updated: fread() hangs apache when file pointer obtained from a url parameter PHPSESSID
ID: 15999 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Feedback Bug Type: Session related Operating System: Linux PHP Version: 4.1.0 New Comment: What is the name of the script you have pasted? What is the content of block.html? It seems you are not calling the same script, but if block.html is calling the script pasted, it's the same. Previous Comments: [2002-03-11 13:28:19] [EMAIL PROTECTED] Ok..let's reopen this. I have no idea what you're doing but if you're not doing what I thought you were, it might be a bug..although that auto_prepend thing makes me wonder.. Please add some example scripts and what needs to be set in php.ini / httpd.conf to reproduce this. [2002-03-11 12:38:04] [EMAIL PROTECTED] Why do you think that block.html is the same script ? Maybe my example is not very clear. But you are right, Apache behavior looks like infinite recursion. Let me explain again and more precisly : the script A (the one in the previous post) tries to open the url B ($url). Script C is auto_prepended (at fread instruction, right ?) and validate the access to the script B, with the session variable. If I don't use the PHPSESSID in the url parameter (and skip the test in the script C), the script is OK. If I use another parameter than PHPSESSID, the script A is OK. Same behavior with fgets, readfile, etc... Note that the script C is auto_prepended only in a subdirectory (containing only docs like B) by apache configuration ( php_value ) and of course scripts A and C are not on this directory. [2002-03-11 11:17:55] [EMAIL PROTECTED] You're calling the same script with that fopen() ? The behaviour is called 'infinite recursion' and yes, it will hang. Not a bug. --Jani [2002-03-11 10:48:52] [EMAIL PROTECTED] http://test/block.html?PHPSESSID=".session_id(); $fp = fopen($url, 'r'); // the file pointer semms to be valid $file = fread($fp,1048576); //hangs here ! echo $file; ?> hangs apache (1.3.x). Same with 4.0.2, 4.0.6 Linux (RH 6.2 and Debian 2.2), never on Win98. Other parameters don't have the same effect. -- Edit this bug report at http://bugs.php.net/?id=15999&edit=1
Bug #15999 Updated: fread() hangs apache when file pointer obtained from a url parameter PHPSESSID
ID: 15999 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Bogus +Status: Open Bug Type: Session related Operating System: Linux PHP Version: 4.1.0 New Comment: Ok..let's reopen this. I have no idea what you're doing but if you're not doing what I thought you were, it might be a bug..although that auto_prepend thing makes me wonder.. Please add some example scripts and what needs to be set in php.ini / httpd.conf to reproduce this. Previous Comments: [2002-03-11 12:38:04] [EMAIL PROTECTED] Why do you think that block.html is the same script ? Maybe my example is not very clear. But you are right, Apache behavior looks like infinite recursion. Let me explain again and more precisly : the script A (the one in the previous post) tries to open the url B ($url). Script C is auto_prepended (at fread instruction, right ?) and validate the access to the script B, with the session variable. If I don't use the PHPSESSID in the url parameter (and skip the test in the script C), the script is OK. If I use another parameter than PHPSESSID, the script A is OK. Same behavior with fgets, readfile, etc... Note that the script C is auto_prepended only in a subdirectory (containing only docs like B) by apache configuration ( php_value ) and of course scripts A and C are not on this directory. [2002-03-11 11:17:55] [EMAIL PROTECTED] You're calling the same script with that fopen() ? The behaviour is called 'infinite recursion' and yes, it will hang. Not a bug. --Jani [2002-03-11 10:48:52] [EMAIL PROTECTED] http://test/block.html?PHPSESSID=".session_id(); $fp = fopen($url, 'r'); // the file pointer semms to be valid $file = fread($fp,1048576); //hangs here ! echo $file; ?> hangs apache (1.3.x). Same with 4.0.2, 4.0.6 Linux (RH 6.2 and Debian 2.2), never on Win98. Other parameters don't have the same effect. -- Edit this bug report at http://bugs.php.net/?id=15999&edit=1
Bug #15999 Updated: fread() hangs apache when file pointer obtained from a url parameter PHPSESSID
ID: 15999 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Bogus Bug Type: Session related Operating System: Linux PHP Version: 4.1.0 New Comment: Why do you think that block.html is the same script ? Maybe my example is not very clear. But you are right, Apache behavior looks like infinite recursion. Let me explain again and more precisly : the script A (the one in the previous post) tries to open the url B ($url). Script C is auto_prepended (at fread instruction, right ?) and validate the access to the script B, with the session variable. If I don't use the PHPSESSID in the url parameter (and skip the test in the script C), the script is OK. If I use another parameter than PHPSESSID, the script A is OK. Same behavior with fgets, readfile, etc... Note that the script C is auto_prepended only in a subdirectory (containing only docs like B) by apache configuration ( php_value ) and of course scripts A and C are not on this directory. Previous Comments: [2002-03-11 11:17:55] [EMAIL PROTECTED] You're calling the same script with that fopen() ? The behaviour is called 'infinite recursion' and yes, it will hang. Not a bug. --Jani [2002-03-11 10:48:52] [EMAIL PROTECTED] http://test/block.html?PHPSESSID=".session_id(); $fp = fopen($url, 'r'); // the file pointer semms to be valid $file = fread($fp,1048576); //hangs here ! echo $file; ?> hangs apache (1.3.x). Same with 4.0.2, 4.0.6 Linux (RH 6.2 and Debian 2.2), never on Win98. Other parameters don't have the same effect. -- Edit this bug report at http://bugs.php.net/?id=15999&edit=1
Bug #15999 Updated: fread() hangs apache when file pointer obtained from a url parameter PHPSESSID
ID: 15999 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Bogus Bug Type: Session related Operating System: Linux PHP Version: 4.1.0 New Comment: You're calling the same script with that fopen() ? The behaviour is called 'infinite recursion' and yes, it will hang. Not a bug. --Jani Previous Comments: [2002-03-11 10:48:52] [EMAIL PROTECTED] http://test/block.html?PHPSESSID=".session_id(); $fp = fopen($url, 'r'); // the file pointer semms to be valid $file = fread($fp,1048576); //hangs here ! echo $file; ?> hangs apache (1.3.x). Same with 4.0.2, 4.0.6 Linux (RH 6.2 and Debian 2.2), never on Win98. Other parameters don't have the same effect. -- Edit this bug report at http://bugs.php.net/?id=15999&edit=1