I'm developing a pretty simple wordpress plugin to connect to a soap service. It works fine on my localhost, but on a production hosting (I tried two different ones) it returns this error:
SoapClient Object ( [trace] => 1 [_exceptions] => [_stream_context] => Resource id #303 [_soap_version] => 1 [sdl] => Resource id #304 ) Fatal error: Uncaught Error: Call to a member function GetModelfunctions() on bool in /home/.sites/278/site7279787/web/jobs/wp-content/plugins/hrjobs/jobsview.php:14...
This is the function:
function hrjobsinit() {
$wsdl = WSDL_PATH;
$handle = curl_init($wsdl);
curl_setopt($handle, CURLOPT_RETURNTRANSFER, TRUE);
$response = curl_exec($handle);
$httpCode = curl_getinfo($handle, CURLINFO_HTTP_CODE);
if ($httpCode > 399)
{
$client = null;
}
else
{
$client = new SoapClient($wsdl, array(
'exceptions' => 0,
'trace' =>true
));
}
curl_close($handle);
return $client;
}
My localhost is PHP Version 7.2.24-0ubuntu0.19.04.2, Apache/2.4.38, cURL 7.64.0
The production hosting is Linux 3.10.0-962.3.2.lve1.5.27.el6h.x86_64, cURL 7.61.0, I've noticed that some cURL stuff is not enabled (IDN, TLS-SRP, PSL) in the production server where it's not working.