How 2 use different ethernet adapters for php ? ( diff ip's)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Deseree
Forum Commoner
Posts: 84
Joined: Mon Feb 13, 2006 11:35 pm

How 2 use different ethernet adapters for php ? ( diff ip's)

Post by Deseree »

Does anyone know how I can use different ip's I binded to my server in php but not use curl_int, I've tried that and POSTING to xml rpc doesn't work with curl_int, i tried, it xmlrpc posts just finewithout using

curl_setopt ($ch, CURLOPT_INTERFACE, $interface_eth);

that one breaks my curl xmlrpc posting..... so i need to know how to use fgets WITH different ip's binded .....

thanks
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

Because they are on the same server there may be other solutions. What is the data you want to share?
(#10850)
Deseree
Forum Commoner
Posts: 84
Joined: Mon Feb 13, 2006 11:35 pm

Post by Deseree »

it's a php script that posts xmlrpc posts that I prefer to run in shell rather than over http:// . It works from different ip's when I run THROUGH apache, but I want to run 100% free of apache ( since apache seems to crash when I run it since it goes for hours ), and when I run the script from shell, it ALWAYS uses the main server's ip.....
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

Maybe just use exec() to run it.
(#10850)
Deseree
Forum Commoner
Posts: 84
Joined: Mon Feb 13, 2006 11:35 pm

Post by Deseree »

arborint wrote:Maybe just use exec() to run it.
but HOW do I select which INTERFACE or ETH0 it will use?

I have 31 ip's on my server....

eth0
eth0:1
eth0:2
eth0:3
eth0:4
eth0:5
.
.
.
eth0:28
eth0:29
eth0:30


I need to be able to select which one it uses..... lol, did you not catch that part or am I missing something with exec(), i've used it before but i don't see how to select which eth to use...
Post Reply