1

I'm trying to connect to a webservice using a PHP wrapper (which is using curl under the covers).

On my local linux machine running PHP 5.3 it works perfectly. However, when I move to a remote server (also running PHP 5.3 on Linux) the call the the webservice URL returns:

getaddrinfo(3) failed for http://server.host.com:8080/login

But when I issue a curl request from the command line, it returns the expected URL.

Can anyone shed any light on this issue?

Thanks!

user101289
  • 297
  • 1
  • 3
  • 13

1 Answers1

4

That's expected. The ping command accepts either an IP address or a hostname and not a URL. Same goes for getaddrinfo() and getnameinfo() functions.

curl works because it is supposed to work with URLs.

dkaragasidis
  • 755
  • 4
  • 11