Reputation: 115
I am working with laravel 5.4. The controller function that using laravel run in browser is working. Same function I called via scheduler it returns error.
Note: Soapclient is enabled in my server. In Controller code:
use SoapClient;
$client = new SoapClient($wsdl, array(
'soap_version' => SOAP_1_1,
'trace' => true, //to debug
));
and in kernel.php
$schedule->command('eld:fetch')
->everyMinute();
Upvotes: 4
Views: 19514
Reputation: 486
PHP Fatal error: Class 'SoapClient' not found in laravel 5.4 means that the SoapClient
class does not been enabled in your server. To do so, follow these steps:
phpinfo()
function and look in the array if SoapClient
is mentioned enabled. If it's not enabled, follow the second step.extension=php_soap.dll
line by removing the semicolon at the beginning, in php.ini
file.SoapClient
is now enabled.use SoapClient;
$client = new SoapClient($wsdl, array('soap_version' => SOAP_1_1, 'trace' => true));
Upvotes: 1