php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29939 HTTP streams not functioning as expected running through web server.
Submitted: 2004-09-01 23:43 UTC Modified: 2004-09-03 13:05 UTC
From: testwicks17543 at yahoo dot com Assigned:
Status: Not a bug Package: HTTP related
PHP Version: 4.3.8 OS: RedHat ES 3
Private report: No CVE-ID: None
 [2004-09-01 23:43 UTC] testwicks17543 at yahoo dot com
Description:
------------
We are currently experiencing issues with HTTP streams within PHP scripts being run through Apache (using the php4_module).  We are not experiencing the issues if we run the php script from the command line.

System info:

System is running RedHat ES 3 with all the latest patches applied.  The system has approx 512 virtual web sites configured in Apache.  The Apache startup script changes the max file descriptors to a number higher than the RedHat default of 1024 (the number is currently set too 409600; we have also tried lower numbers such as 8192; please, note that Apache opens more than 1024 files upon startup and that the default setting is no longer an option; each virtual site has its own access log and error log).

RPM list:

kernel-smp-2.4.21-15.0.4.EL
httpd-2.0.46-32.ent.3
php-4.3.2-11.1.ent
php-mysql-4.3.2-11.1.ent


PHP specifics:

'./configure' '--host=i386-redhat-linux' '--build=i386-redhat-linux' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-db4=/usr' '--with-curl' '--with-dom=/usr' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-ttf' '--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-regex=system' '--with-xml' '--with-expat-dir=/usr' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-discard-path' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-mbregex' '--without-oci8' '--with-pear=/usr/share/pear' '--with-imap=shared' '--with-imap-ssl' '--with-kerberos=/usr/kerberos' '--with-ldap=shared' '--with-mysql=shared,/usr' '--with-pgsql=shared' '--with-unixODBC=shared' '--enable-memory-limit' '--enable-bcmath' '--enable-shmop' '--enable-versioning' '--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mcal' '--with-apxs2filter=/usr/sbin/apxs'



We would like to know how to further troubleshoot this error to determine the reason why this error message started happening.  We have other web servers configured identically (same version of RedHat distribution, same version of Apache, PHP etc.), with fewer web sites that are not experiencing this issue.

Please, let us know if there is any additional information needed.

Thank you,


Reproduce code:
---------------
Code that produces errors:

<?php
fopen("http://somewebhost.domain.gTLD/index.html", "r");
$httpfile  = file_get_contents("http://somewebhost.domain.gTLD/index.html");
include 'http://somewebhost.domain.gTLD/index.html';
?>

Expected result:
----------------
The contents of index.html.

Actual result:
--------------
Errors:

Warning: fopen(http://somewebhost.domain.gTLD): failed to open stream: HTTP request failed! in /www/localwebhost.domain.gTLD/htdocs/test.php on line 2

Warning: file_get_contents(http://somewebhost.domain.gTLD/index.html): failed to open stream: HTTP request failed! ? `? in /www/localwebhost.domain.gTLD/htdocs/test.php on line 3

Warning: main(http://somewebhost.domain.gTLD/index.html): failed to open stream: HTTP request failed! 0v???c x?N1??a1??:   in /www/localwebhost.domain.gTLD/htdocs/test.php on line 4

Warning: main(): Failed opening 'http://somewebhost.domain.gTLD/index.html' for inclusion (include_path='.') in /www/localwebhost.domain.gTLD/htdocs/test.php on line 4

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-09-03 13:05 UTC] jorton@php.net
Please file bugs in the RHEL php package at https://bugzilla.redhat.com/bugzilla/.

PHP socket handling is not reliable and may cause segfaults or hangs if you push the fd numbers over 1024.  This is a duplicate of #24189.
 
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Feb 05 18:03:43 2023 UTC