Edit report at https://bugs.php.net/bug.php?id=66208&edit=1
ID: 66208
Updated by: requinix@php.net
Reported by: tronox at hotmail dot com
Summary: PHP-FPM Bind to address
Status: Wont fix
Type: Feature/Change Request
Package: *Network Functions
Operating System: Amazon AMI
PHP Version: 5.5.6
Block user comment: N
Private report: N
New Comment:
So wait, are you talking about the IP address that your web server is binding to, which is what your
title and latest reply are talking about (despite how it's not PHP-FPM that does that), or are
you talking about the IP address that remote servers see your HTTP requests coming from, which is
what your description was about?
Previous Comments:
------------------------------------------------------------------------
[2013-11-30 08:36:35] tronox at hotmail dot com
MANY services out there allow for binding of their outgoing IPs. Even PHP does via scripting. I see
no reason why php can't have a default IP binding setting. This would not only make it possibly
more secure. But it would also support virtual hosting much better.
Making a VPM for every virtual host is a bit much. A Simple chroot suffices for most things packed
with open_basedir. The only remaining issue is what IP clients are using for outgoing connections.
Which opens a whole lot of security issues on a system. IE: I can't block or allow specific IPs
outgoing traffic for specific ports. I can't track traffic usage reliably for a specific IP.
------------------------------------------------------------------------
[2013-11-30 07:39:22] requinix@php.net
A full explanation of why that's not possible is out of the scope of this bug reporting system,
but suffice it to say that's not how networking works.
------------------------------------------------------------------------
[2013-11-30 06:40:23] 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.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=66208&edit=1