php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70199 fsockopen fails with IPv6
Submitted: 2015-08-06 04:32 UTC Modified: 2015-08-16 04:23 UTC
From: diogo at mgniers dot com Assigned:
Status: No Feedback Package: *General Issues
PHP Version: 5.4.43 OS: CentOS 6.6
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2015-08-06 04:32 UTC] diogo at mgniers dot com
Description:
------------
On a server with support for IPv4 and IPv6, whereas the target domains support both protocols, the fsockopen function only works with IPv4, causing timeout when try to connect via IPv6.

Test script:
---------------
$con = fsockopen('mx.mydomain.com', 587, $errno, $errstr, 10);
if(empty($con)) echo "Not connected: ".$errno." - ".$errstr;
else echo "Connected!";

Expected result:
----------------
Connected!

Actual result:
--------------
Not connected: 110 - Connection timed out

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-08-06 04:52 UTC] requinix@php.net
-Status: Open +Status: Feedback
 [2015-08-06 04:52 UTC] requinix@php.net
So you can connect to it, from the same server, to the same server and the same port, all over IPv6, using other applications (like telnet) but not with PHP?
 [2015-08-16 04:23 UTC] php-bugs at lists dot php dot 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 "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 22:01:29 2024 UTC