On a server with multiple IPs routed to it, I'd like to use PHP's fsockopen to open from a non-primary-interface ip (or a comparable method to be able to make fread and fwrites from a different ip)
This is not possible with fsockopen. You have to use the sockets wrapper:
fsockopen
$sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); socket_bind($sock, '192.168.1.100'); socket_connect($sock, 'stackoverflow.com', 80);
1.4m articles
1.4m replys
5 comments
57.0k users