Bug 132003 - fopen doesn't work across remote connections while under Apache
fopen doesn't work across remote connections while under Apache
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: php (Show other bugs)
3.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Joe Orton
David Lawrence
http://webhost3.dejazzd.com/test.php
:
Depends On:
Blocks: 123574
  Show dependency treegraph
 
Reported: 2004-09-07 14:32 EDT by Daniel Fisher
Modified: 2007-11-30 17:07 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-12-21 13:54:52 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Daniel Fisher 2004-09-07 14:32:34 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.3)
Gecko/20040803

Description of problem:
Customer runs a very simple script:

<?php 
fopen("http://webhost12.dejazzd.com/index.html", "r"); 
$httpfile  =
file_get_contents("http://webhost12.dejazzd.com/index.html"); 
include 'http://webhost12.dejazzd.com/index.html'; 
?> 

Script fails with error:
'failed to open stream: HTTP request failed! '

Script runs correctly in command line, but fails when run as a script
behind Apache.


Version-Release number of selected component (if applicable):
php-4.3.2-11.1.ent

How reproducible:
Couldn't Reproduce

Steps to Reproduce:
1. Copy script
2. Run from web
    

Actual Results:  Worked fine for me, customer can't get it to work.

Expected Results:  Should show the text:
'DEJazzd'

Additional info:

I have spoken with Joe Orton about this:
http://bugs.php.net/bug.php?id=24189

I asked customer to recompile with '--enable-debug' (as recommended here: 
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=c5scrb%24q8k%241%40FreeBSD.csie.NCTU.edu.tw&rnum=2&prev=/groups%3Fq%3Dphp%2Bfopen%2B%27stream%2Bfailed%27%26hl%3Den%26lr%3D%26ie%3DUTF-8%26selm%3Dc5scrb%2524q8k%25241%2540FreeBSD.csie.NCTU.edu.tw%26rnum%3D2
), but still had issue
Comment 1 Joe Orton 2004-09-07 14:37:38 EDT
Can you confirm whether the customer has configured httpd with a large
number of log files, and is running the server with an increased
ulimit -n?  That is key as to whether this has anything to do with the
upstream bug you reference.
Comment 2 Daniel Fisher 2004-09-07 14:40:21 EDT
The customer does indeed have a large number of logfiles and has
modified their ulimit -n.

How does this affect the prognosis/potetnial fix?

Thank you for your time,
Daniel Fisher
Comment 3 Joe Orton 2004-09-07 15:38:57 EDT
Yes, thank you, that confirms that this is problem described in the
upstream bug report.   I will make test packages available shortly
which should work around the issues reported.
Comment 4 Joe Orton 2004-09-08 06:37:09 EDT
Packages which include a workaround for this issue are available for
test purposes from the following location:

http://people.redhat.com/jorton/Taroon-php/

Please note that even with this workaround, there are still many
places where PHP does not correctly handle fd numbers greater than
1024 and may behave unreliably in such configurations: notably
socket_select and stream_select, also any use of the curl extension.

Comment 5 D&E Communications 2004-09-09 10:45:35 EDT
We applied the rpms last night and they seemed to fix the problem. 
Thank you all for the help.  

Is this fix going to be in future releases?
Comment 6 Joe Orton 2004-09-09 11:01:07 EDT
Thanks for testing this out.  This fix is scheduled for inclusion in a
future RHEL3 update.
Comment 7 D&E Communications 2004-09-09 11:15:56 EDT
We applied the rpms last night and they seemed to fix the problem. 
Thank you all for the help.  

Is this fix going to be in future releases?
Comment 8 D&E Communications 2004-09-09 11:17:26 EDT
Sorry I hit reload. 
Comment 9 Joe Orton 2004-09-09 11:21:47 EDT
No problem.
Comment 10 Jon Benson 2004-12-19 19:51:14 EST
Just getting myself added so I know when the patch is released.  :)
Comment 11 Mark J. Cox (Product Security) 2004-12-21 13:54:52 EST
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2004-687.html

Note You need to log in before you can comment on or make changes to this bug.