I have move my site to another server. After moving I've started to get Soap error as "Could not connect to host". The service I try to connect uses https protocol.
Old server's PHP version : 5.4 New server's PHP version : 5.6.16
There is no error in connection and I successfully connect to server that I wrote codes below :
try {
$client = new SoapClient('https://www.example.com', [
'trace' => 1,
'stream_context'=> stream_context_create(['ssl'=> array('verify_peer'=>false, 'verify_peer_name'=>false)])
]);
} catch (SoapFault $sf) {
echo $sf->getMessage();
}
But I got error after calling a method :
try {
$response = $client->method($parameter);
} catch (SoapFault $sf) {
echo $sf->getMessage();
}
Result of this code : "Could not connect to host".
How can I solve this problem? Many thanks for your interest in advance.