|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2013-11-30 06:40 UTC] tronox at hotmail dot com
Description:
------------
While running multiple hosts on multiple ips:
I'm able to get a specific _SERVER["SERVER_ADDR"] for each host. However when using functions such as file_get_contents('example.com/whatismyip.php') it will always return the main IP of the server rather then the IP in _SERVER["SERVER_ADDR"].
My request is that either the IP used for functions such as file_get_contents is set to _SERVER["SERVER_ADDR"] or there be a setting that can be passed into PHP or PHP-FPM so that the outgoing IP can be set.
Seems that is _SERVER["SERVER_ADDR"] returns a specific IP that that should be used as default for outgoing traffic.
Expected result:
----------------
_SERVER["SERVER_ADDR"] be used as the default IP/Interface for outgoing PHP traffic.
Actual result:
--------------
_SERVER["SERVER_ADDR"] is ignored and the server's main IP is used instead.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 17:00:01 2025 UTC |
it would be great if there is a configuration to set this setting globally. something like: ini_set('socket_outbound','127.0.0.1');