#41932 [Opn->Fbk]: fsockopen - apache2 poblem with many vhosts
| From: | derick@php.net | Date: | Mon, 09 Jul 2007 07:53:01 +0000 |
| Subject: | #41932 [Opn->Fbk]: fsockopen - apache2 poblem with many vhosts | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-114768@lists.php.net to get a copy of this message | ||
ID: 41932
Updated by: derick@php.net
Reported By: yaboll at interia dot pl
-Status: Open
+Status: Feedback
Bug Type: Sockets related
Operating System: linux
PHP Version: 4.4.7
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows (zip):
http://snaps.php.net/win32/php5.2-win32-latest.zip
For Windows (installer):
http://snaps.php.net/win32/php5.2-win32-installer-latest.msi
Previous Comments:
------------------------------------------------------------------------
[2007-07-09 07:43:44] yaboll at interia dot pl
Description:
------------
I found problem in fsockopen() when I use php as module mod_php in
apache2.
When I create many vhost fsckopen() doesn't work good and generate
child sigterm error.
I made some experimets with vhost number:
vhosts number - error
less than 1005 - work fine
1006-1007 - white page (no error)
1008 - around 1164 - "Operation now in progress (115)"
around 1150 - around 1164 - "Bad file descriptor (9)"
around 1164 - around 1200 - "Operation now in progress (115)"
1200 and more - apache child sigterm
core in sigterm:
(gdb) bt
#0 php_hostconnect (host=Cannot access memory at address 0xc
) at /srv/dev-dev/php4-debug/php4/php4-4.4.7/main/network.c:490
Cannot access memory at address 0x4
(gdb)
When I use php in cgi/cli mode all works fine.
Reproduce code:
---------------
<?php
$fp = fsockopen("www.onet.pl", 80, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br />\n";
} else {
$out = "GET / HTTP/1.1\r\n";
$out .= "Host: www.onet.pl\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
while (!feof($fp)) {
echo fgets($fp, 128);
}
fclose($fp);
}
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41932&edit=1