ayadlin brintha
ayadlin brintha

Reputation: 115

PHP Fatal error: Class 'SoapClient' not found in laravel 5.4

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

Answers (1)

Serge Kishiko
Serge Kishiko

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:

  1. Check first if it's enabled with phpinfo() function and look in the array if SoapClient is mentioned enabled. If it's not enabled, follow the second step.
  2. Uncomment the extension=php_soap.dll line by removing the semicolon at the beginning, in php.ini file.
  3. The next step is to restart your server.
  4. Now return again to the first step to see if SoapClient is now enabled.
  5. At this step, you can now import your class like this:

use SoapClient; $client = new SoapClient($wsdl, array('soap_version' => SOAP_1_1, 'trace' => true));

Upvotes: 1

Related Questions