php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21736 fsockopen timeouts
Submitted: 2003-01-18 16:36 UTC Modified: 2003-02-04 16:50 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:1 (50.0%)
From: support at websiteout dot net Assigned:
Status: No Feedback Package: Sockets related
PHP Version: 4.3.1-dev OS: Linux (kernel 2.4.18)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: support at websiteout dot net
New email:
PHP Version: OS:

 

 [2003-01-18 16:36 UTC] support at websiteout dot net
Hi,

PHP4.3.0 is a great version. Congratulations.
Just on thing about fsockopen()
Let's try this simple script :
<?
echo fsockopen("www.msnbc.com", 80);
?>
It works fine in PHP4.2.x but it timeouts in PHP4.3.0
Thanks a lot

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-18 18:17 UTC] wez@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.


What times out?  The script or the fsockopen call?
What is the error message?

*please* read the info here:
http://bugs.php.net/how-to-report.php
and then fill in more information to make this a useful bug report.
 [2003-01-18 19:45 UTC] support at websiteout dot net
Hi,
Thanks for your answer.
You're right, it is not the fsockopen() which times out. It is the script itself because the fsockopen() never responds.
After 1 minute waiting for a respond, my browser give up.
So I don't have any error message from the script.

Here is some hints:
- the script runs fine on PHP4.2.x but not on PHP4.3.0
- fsockopen("207.46.245.61", 80); works fine on both PHP4.3.0 and PHP4.2.x
- fsockopen("lb.msnbc.com", 80); also works fine on both PHP4.3.0 and PHP4.2.x
- if you need, you can find the phpinfo page at this address :
http://w06.httpserveur.net/phpinfo.php

Thans a lot.
 [2003-01-19 03:44 UTC] wez@php.net
And did you read the NEWS for PHP 4.3.0?

"Added php.ini option "default_socket_timeout" to set the
timeout limit for PHP network streams.
(kalowsky, ilia@prohost.org, Wez)"

This setting is documented here:
http://www.php.net/manual/en/ref.filesystem.php

Changing this to a documentation problem as the fsockopen page should mention this new feature (which helps prevents potential DOS attacks), and the documentation of the ini setting should be listed in either the network functions summary or in the new streams section.
 [2003-01-19 03:48 UTC] wez@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip

sorry - I just re-read you report (it's early!).
Can you try a stable snapshot?
If it still hangs, can you read the instructions here:
http://bugs.php.net/bugs-generating-backtrace.php
and follow the "If you can't get a core file" section;
when/if php hangs (after approx 1 minute), interrupt the httpd by pressing CTRL-C and then type "bt full".

 [2003-01-19 03:53 UTC] wez@php.net
I stand by my original comment; you have your max_execution_time set to 30 seconds, while the default_socket_timeout is 60 seconds.
Try setting it to something less than 30 seconds (or even using the timeout parameter to fsockopen).
 [2003-01-19 09:45 UTC] support at websiteout dot net
Hi,

We have set default_socket_timeout=20
It changes nothing. 
fsockopen() doesn't respond even after 20 secs.
After 1 minute waiting for a respond, my browser give up.
So I don't have any error message from the script.
Again, it works fine in PHP4.2.x. It responds (positively) in less than 3 secs and the socket is correctly open.
Tonight I will try with
 http://snaps.php.net/php4-STABLE-latest.tar.gz
I will tell you what happens.

Thanks.
 [2003-01-19 18:28 UTC] kalowsky@php.net
leaving marked as feedback until user reports back.
 [2003-01-19 18:34 UTC] support at websiteout dot net
Hi,

I just tried :
http://snaps.php.net/php4-STABLE-latest.tar.gz
and the problem remains the same.

I'm sorry to bore you with that.
 [2003-01-19 23:57 UTC] sniper@php.net
FYI: I can NOT reproduce this with PHP 4.3.1-dev.


 [2003-01-20 05:20 UTC] support at websiteout dot net
Don't worry so. I will ask to my developpers to look in fsock.c to correct the problem.
You can close the bug if you want.
Have a good day.
 [2003-01-20 09:04 UTC] wez@php.net
Please try generating a backtrace as I asked, otherwise we will never know what is causing this problem.
 [2003-02-04 16:50 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 14:01:28 2024 UTC