Edit report at http://bugs.php.net/bug.php?id=39803&edit=1

 ID:               39803
 User updated by:  marcelo at tpn dot com dot br
 Reported by:      marcelo at tpn dot com dot br
 Summary:          fsockopen() bug
 Status:           Bogus
 Type:             Bug
 Package:          Sockets related
 Operating System: FreeBSD 6.2
 PHP Version:      4.4.9

 New Comment:

Folks,



Regardless if it's a PHP problem or not, here is the SOLUTION:



fsockopen(), fopen() and other socket functions will not work in Apache
with 

many virtualhosts.



You need to increase the file descriptor limits when compiling Apache
and PHP 

(including its 

modules).



If you use FreeBSD, edit your /etc/make.conf and add:



EXTRA_CFLAGS="-DFD_SETSIZE=8192"



And rebuild Apache, PHP and its modules. I believe that 8192 is a number
big 

enough, btw you can 

try a different number. I don't know how to do this using Linux, but
should be 

similar.



There are MANY people with the same problem, and you are always saying
this 

isn't a PHP bug, and 

the user should fix him system.



IMHO, if its not a bug, why have I to recompile it to make it works?



My suggestion: create a compile parameter to compile PHP and its modules
with a 

bigger file 

descriptor limit (e.g. --big-fd-limit).



That's my two cents. ;-)



--

Marcelo Coelho


Previous Comments:
------------------------------------------------------------------------
[2009-07-23 22:48:03] j...@php.net

Apparently this isn't any PHP bug like already said many times.

------------------------------------------------------------------------
[2009-07-14 05:05:45] marcelo at tpn dot com dot br

Now fsockopen crashes apache, but only when PHP is in apache module 

mode.

------------------------------------------------------------------------
[2007-07-11 12:40:39] j...@php.net

So you're saying this problem exist in PHP 5.2.3 also?

If so, please set the version in this report to "5.2.3, 4.4.7" 

------------------------------------------------------------------------
[2007-05-03 18:29:51] marcelo at tpn dot com dot br

This is a PHP problem.



I have both CGI and Apache Module.



fsockopen() works on CGI mode, but doesn't in Apache Module.

------------------------------------------------------------------------
[2007-04-05 19:59:08] tony2...@php.net

>The system is always returning EINPROGRESS.

Why is that PHP problem?

Fix your system instead.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    http://bugs.php.net/bug.php?id=39803


-- 
Edit this bug report at http://bugs.php.net/bug.php?id=39803&edit=1

Reply via email to