|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[1998-10-25 17:00 UTC] maupin at easystreet dot com
Hi,
When Apache is compiled with PHP and is configured with a
large number of virtual hosts, each of which has its own set of log
file directives, PHP returns empty documents (i.e., Communicator
reports "Document contains no data"). In my experiments, I've found
that the problem manifests itself when somewhere between 110 and 115
log file directives are present. My configuration uses "TransferLog",
"ErrorLog", and "RewriteLog", but I suspect other log directives would
contribute to the problem as well. I'm running PHP v3.0.5 as a module
in Apache v1.3.2 under SunOS v4.1.4. No modules were compiled into
PHP. I've observed the same problem in PHP versions going back to at
least v3.0. Red Hat Linux v5.1 with kernel v2.0.33 appears immune to
the problem.
The call to the "YY_INPUT" macro on line 4329 in the
"yy_get_next_buffer" function of "language-scanner.c" generates the
error. I've run Apache with the "-X" option under gdb and while the
server does not core dump, it exits with status code 2 after executing
"YY_INPUT" and "input in flex scanner failed" is written to the
server's error log. PHP was compiled with GNU flex v2.5.4 and gcc
v2.7.2.2. Here is a backtrace captured just prior to the execution of
"YY_INPUT"...
#0 yy_get_next_buffer () at language-scanner.c:4329
#1 0x50214 in lex_scan (phplval=0xefffe670) at language-scanner.c:4164
#2 0xc740 in read_next_token (tcm=0xcf098, token=0xefffe58c,
phplval=0xefffe670) at token_cache.c:139
#3 0x40c8 in phplex (phplval=0xefffe670) at main.c:435
#4 0x3d770 in phpparse () at /usr/local/share/bison.simple:387
#5 0x62e0 in php3_parse (yyin=0xef6b1fd8) at main.c:1465
#6 0x66a8 in apache_php3_module_main (r=0x146b30, fd=128,
display_source_mode=0, preprocessed=0) at main.c:1845
#7 0x25b4 in send_php3 ()
#8 0x263c in send_parsed_php3 ()
#9 0x59aa8 in ap_invoke_handler ()
#10 0x7a54c in process_request_internal ()
#11 0x7a5cc in ap_process_request ()
#12 0x6dbfc in child_main ()
#13 0x6ddf4 in make_child ()
#14 0x6dff8 in startup_children ()
#15 0x6eb24 in standalone_main ()
#16 0x6f694 in main ()
The problem can be reproduced by creating an Apache
configuration with simple <VirtualHost> sections like the following.
I recommend starting with 120 and removing "TransferLog" directives
until the error disappears. The ServerName directives aren't
necessary, but they aid in counting.
Listen 192.168.1.1:80
NameVirtualHost 192.168.1.1:80
<VirtualHost 192.168.1.1:80>
ServerName host001
TransferLog /dev/null
</VirtualHost>
<VirtualHost 192.168.1.1:80>
ServerName host002
TransferLog /dev/null
</VirtualHost>
</VirtualHost>
.
.
.
<VirtualHost 192.168.1.1:80>
ServerName host119
TransferLog /dev/null
</VirtualHost>
<VirtualHost 192.168.1.1:80>
ServerName host120
TransferLog /dev/null
</VirtualHost>
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 03:00:01 2025 UTC |
You're hitting the file descriptor limit of your environment. If you truss Apache, you'd probably see that it fails trying to open files. The limit on your Solaris box is probably lower than the limit on the RedHat box, which is why you only experience it under Solaris. You can check the file descriptor limit in the shell limits ('limit' under tcsh, or 'ulimit -a' under sh) Note that setting the TransferLog to /dev/null does NOT save you a file descriptor - you'd have just as many open file descriptors pointing at /dev/null (which would bring you to over 200 open files, which is dangerously close to 256, which is often the fd limit)