php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49200 stream bindto context generates an error
Submitted: 2009-08-09 09:40 UTC Modified: 2010-05-18 10:11 UTC
From: jeremy at ssnet dot ca Assigned:
Status: Not a bug Package: Streams related
PHP Version: 6SVN-2009-08-09 (SVN) OS: FreeBSD 7.2-STABLE
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jeremy at ssnet dot ca
New email:
PHP Version: OS:

 

 [2009-08-09 09:40 UTC] jeremy at ssnet dot ca
Description:
------------
Specifying any IP address for bindto in stream_context_set_option() produces an error "(local_addr context option is not a string.)"

Reproduce code:
---------------
$context = stream_context_create ();
stream_context_set_option ($context, 'socket', 'bindto', '127.0.0.1:0');
$contents = file_get_contents ("http://php.net", FALSE, $context);

Expected result:
----------------
Should return the contents of php.net

Actual result:
--------------
Warning: file_get_contents(http://php.net/): failed to open stream: local_addr context option is not a string.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-05-18 10:11 UTC] mike@php.net
-Status: Open +Status: Bogus
 [2010-05-18 10:11 UTC] mike@php.net
Not reproducible, I get

Warning: file_get_contents(http://php.net): failed to open stream: Invalid argument

unless I specify an IP address connected to the outside world.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Nov 17 17:01:36 2019 UTC