php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31080 ftp_connect() fails on a system where there is a large number of open files.
Submitted: 2004-12-14 04:12 UTC Modified: 2005-04-24 15:56 UTC
Votes:3
Avg. Score:5.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:2 (66.7%)
From: jon at destra dot com Assigned:
Status: Wont fix Package: FTP related
PHP Version: 4CVS-2005-03-21 OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
4 + 6 = ?
Subscribe to this entry?

 
 [2004-12-14 04:12 UTC] jon at destra dot com
Description:
------------
ftp_connect fails on a server with a large number of open files.

Eg.  In a virtual hosting environment where Apache has 1000+ log files open.



Reproduce code:
---------------
$ftp1 = ftp_connect('127.0.0.1') or die("Couldn't connect to server");


Expected result:
----------------
Established connection with a handle via $ftp1.

Actual result:
--------------
The connection fails.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-12-14 14:33 UTC] derick@php.net
You just run out of filedescriptors. This is not something PHP can fix for you. You either need to cut down in the number of Open files, or adjust your kernel parameters.
 [2004-12-15 00:55 UTC] jon at destra dot com
Ahh, no I didn't.  I have more then enough file descriptors but PHP is not using them.

[root@ozhlin01 root]# cat /proc/sys/fs/file-max
32768

I suspect it is hard coding it's max number of file handles?
 [2004-12-15 02:30 UTC] jon at destra dot com
Please note I opened this ticket at the suggestion of Wez Furlong.  Please also take a look at the following:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=125258
 [2004-12-15 13:51 UTC] jorton@php.net
We've just been using hacky workarounds for this which I doubt anyone really wants in the 4.3.x tree.  Wez has fixed all such problems properly in 5.0.3 so the proper solution lies there.
 [2004-12-17 02:59 UTC] sniper@php.net
Assigning to Wez then, if he would be so nice to fix this in 4.3.x branch too. :)
 [2004-12-17 03:02 UTC] wez@php.net
I don't have the time to back-port the patch, which is why I suggested opening up this bug report.
 [2005-04-24 15:56 UTC] sniper@php.net
It works in PHP 5 so use PHP 5.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 19:01:29 2024 UTC