Binding an ip to php curl

Centurius

New Member
Is there a way to bind an ip to php's curl functions without editing the source code of the script? Is it possible to that just by editing php.ini or apache's conf? You want the function to operate through a specific IP or what exactly did you mean? You can either edit the script, or you can use 'route' on the server. But using 'route' will bind all operations on the server to that IP address, and not just a specific script/file. Ah but the thing is I just want it to be with that specific application - php. I'm running other apps on a different ip. Apache's listen config only changes the incoming ip but not the outgoing :/ Hello,

if you need to bind php script to another IP incoming traffic only (outgoing will be handled by main server IP) then you will have to bind Apache as subdomain (sub.domain.com) on the another IP.

and put the script on that subdomain .

well at least that what I understood from your last post
smile.gif


Highest Regards
Mohammed H No, I'm looking to bind outgoing ip. ok then nginx with fastcgi_bind to php script can do that for you
smile.gif


or if you have apache take a look at this tut
http://blog.nachtarbeiter.net/2008/08/21/binding-phps-fsockopen-to-a-specific-ip-address/

didn't try it though but comments seems ok for me.

Highest Regards
Mohammed H You could, alternatively, create a VM on the main server and host the php app on that. But that's a wasteful method, since VMs are redundant if you're only going to use them for one application.

Route or curl's ip bind function are your best options. CURLOPT_INTERFACE.

If you edit the code. Well I didn't resolve the problem but just went around it. I didn't create a VM as LT suggested as that would waste too much resources so I just went with aria2's bind interface capability instead of php's curl func
smile.gif
 
Top