|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-07-09 07:43 UTC] 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);
}
?>
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 11 16:00:01 2025 UTC |
There is no nfile limit in apache server. When i change nfile limit I have the same results (error or seqfault) Limit are set to unlimited/high value intentionally for this test: This is results in system('ulimit -a'); core file size (blocks, -c) unlimited data seg size (kbytes, -d) unlimited file size (blocks, -f) unlimited max locked memory (kbytes, -l) unlimited max memory size (kbytes, -m) unlimited open files (-n) 1048576 pipe size (512 bytes, -p) 8 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) unlimited virtual memory (kbytes, -v) 250000 I would like to emphasize that when I use php 5.2 everything works fine within the same limits/apache2 config. The problem is connected with php 4.4.7 in mod_php. When i use 4.4.7 in cgi, or php 5.2 in mod_php (same ulimit and apache2 config) or 5.2 in cgi mode script return good results.