stijnvb Posted February 12, 2011 Share Posted February 12, 2011 I would like to use an external API, and access it with my 2nd IP address of the server. Is this possible? And if so, how? Example: primary ip: 4.5.6.7 secondary ip: 4.5.6.8 primary ip is used to host several websites the PHP script I made runs in CLI, I want it to access the external API from my secondary ip. Thanks! Quote Link to comment Share on other sites More sharing options...
Fergal Andrews Posted February 13, 2011 Share Posted February 13, 2011 Hi stijnvb, I've never done this myself but I think you can achieve what you are looking for by utilising PHP's socket functons. Have a look in the manual at "Socket" and "fsockopen()" in particular. Cheers, Fergal Quote Link to comment Share on other sites More sharing options...
stijnvb Posted February 13, 2011 Author Share Posted February 13, 2011 Hi stijnvb, I've never done this myself but I think you can achieve what you are looking for by utilising PHP's socket functons. Have a look in the manual at "Socket" and "fsockopen()" in particular. Cheers, Fergal Thanks for the tip. I'm not sure why I didn't think of it sooner, but I just used cURL, as I stated in an earlier post ... i was using a class provided by the API provider, and did not really bother looking into it. Problem solved :-) Thanks for the help! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.