I\'m trying to invoke a WS over https on a remote host:remote port and I get:
Error fetching http headers
using the PHP5 SoapCli
Just wanted to share the solution to this problem in my specific situation (I had identical symptoms). In my scenario it turned out to be that the ssl certificate provided by the web service was no longer trusted. It actually turned out to be due to a new firewall that the client had installed which was interfering with the SOAP request, but the end result was that the certificate was not being correctly served/trusted.
It was a bit difficult to track down because the SoapClient call (even with trace=1) doesn't give very helpful feedback.
I was able to prove the untrusted certificate by using:
openssl s_client -connect :
I know this won't be the answer to everyone's problem, but hopefully it helps someone. Either way I think it's important to realise that the cause of this error (faultcode: "HTTP" faultstring: "Error Fetching http headers") is usually going to be a network/socket/protocol/communication issue rather than simply "not allowing enough time for the request". I can't imagine expanding the default_socket_timeout value is going to resolve this problem very often, and even if it does, surely it would be better to resolve the issue of WHY it is so slow in the first place.