0

how to set PHP-FPM (> 7) to bind outgoing connection to specific socket/ip ?
i know there is pool directive

listen = 127.0.0.1:port

but its for incoming connections but what with outgoing ?

ceph3us
  • 135
  • 10
  • The listen directives have nothing to do with outbound connections. – EEAA Apr 29 '17 at 02:28
  • @EEAA so how set outbound socket ? – ceph3us Apr 29 '17 at 02:38
  • With your operating system's network stack. – EEAA Apr 29 '17 at 02:39
  • @EEAA you refer to iptables ? most of programs could bind outbound/inbound sockets ( eg privoxy, dante, nginx, dovecot, postfix) php-fpm cant ? – ceph3us Apr 29 '17 at 02:42
  • No, you're discussing routing, so your routing tables need to be set correctly. – EEAA Apr 29 '17 at 02:43
  • how i route traffic per process / socket (php-fpm)?? this is a socket layer so app should handle it and see for example https://serverfault.com/questions/128357/routing-application-traffic-through-specific-interface as i said i need to mark packets first to route so iptables ! – ceph3us Apr 29 '17 at 02:51

1 Answers1

0

You could also do this at the cURL level by binding a cURL instance to an interface:

curl_setopt($ch, CURLOPT_INTERFACE, 'x.x.x.x');
Zach
  • 109
  • 1