Binding an ip to php curl

Status
Not open for further replies.

masterb56

Active Member
1,420
2010
56
0
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?
 
9 comments
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 :)

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.
 
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 :)
 
Status
Not open for further replies.
Back
Top