php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17407 File inclusion stops working
Submitted: 2002-05-24 05:46 UTC Modified: 2002-09-11 20:01 UTC
From: js at netcamp dot se Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.2.2 OS: Solaris 8
Private report: No CVE-ID: None
 [2002-05-24 05:46 UTC] js at netcamp dot se
I am not sure of the bug type...

After running the apache server for about 14 days or
sometimes after a SIGHUP restart, I get the following
error messages, when accessing normaly working scripts:
Warning: file("/usr/local/apache/ncoffice/style/rep_head.html") - Too many open files in /usr/local/apache/ncoffice/1.5.22/php/common.inc.php on line 1162

Warning: Failed opening 'php/report_time_list_proj.inc.php' for inclusion (include_path='') in /usr/local/apache/ncoffice/1.5.22/php/report_time_list.inc.php on line 161

Warning: file("/usr/local/apache/ncoffice/style/rep_tail.html") - Too many open files in /usr/local/apache/ncoffice/1.5.22/php/common.inc.php on line 1162


After a stop and start it works fine again.

Wath's happening?

Configuration:
'./configure' '--with-apache=../apache_1.3.22' '--enable-track-vars' '--with-imap=/usr/local/src/imap/imap-2001a/c-client' '--with-mysql=/usr/local/mysql' '--with-zlib=/usr/local' '--with-gd=/usr/local' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr/local' '--with-xpm-dir=/usr/local' '--with-freetype-dir=/usr/local' '--with-curl=/usr/local' '--enable-exif'

Regards,
Johan

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-24 07:06 UTC] hholzgra@php.net
well, you obviously run out of file handles

might be related to excessive use of persistant connections,
to a php extension not closing all openend files on request shutdown or even to some other apache module or apache itself instead of php ... really hard to tell without further information :(
 [2002-08-09 04:13 UTC] js at netcamp dot se
I have upgraded to 4.2.2, the problem stil exist.

Is there a way to tune the amount of avalibel file handels?
Is there a way to se the current status of file handels?
Can file handels be "lost" when I do SIGHUP to restart?

If I do a fopen and forget the fclose is that file closed
anyway when the PHP script ends?

Regards,
Johan
 [2002-09-11 20:01 UTC] iliaa@php.net
Sorry, but the bug system is not the appropriate forum for asking
support questions. Your problem does not imply a bug in PHP itself.
For a list of more appropriate places to ask for help using PHP,
please visit http://www.php.net/support.php

Thank you for your interest in PHP.

You can tune the number of allowed file handles by using the ulimit utility. I believe the default value is 1024, which is not all that much considering that in Apache 1.3X case, the file handles opened by all apache children are summed up. If you have many apache children or php pages that refence many other php files you should raise that limit.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 16 13:01:31 2025 UTC