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 ?

6
  • The listen directives have nothing to do with outbound connections.
    – EEAA
    Apr 29, 2017 at 2:28
  • @EEAA so how set outbound socket ?
    – ceph3us
    Apr 29, 2017 at 2:38
  • With your operating system's network stack.
    – EEAA
    Apr 29, 2017 at 2: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, 2017 at 2:42
  • No, you're discussing routing, so your routing tables need to be set correctly.
    – EEAA
    Apr 29, 2017 at 2:43

1 Answer 1

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');
1
  • but what when i use PDO ? is a cURL a layer for network request thru PDO?
    – ceph3us
    Apr 30, 2017 at 2:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .