Michael
Michael

Reputation: 576

Laravel Artisan command for soap call "Class 'SoapClient' not found"

I have an artisan command where I do a soap call.

So I use the SoapClient

use SoapClient;

When I test run my command from an url like this:

Route::get('test-command', function() {
    Artisan::call('updateRegisterLogs');
});

Everything works great!

Now when I try to run it with artisan on my linux server to test the command to create a cronjob I get the following error:

[Symfony\Component\Debug\Exception\FatalThrowableError]

Class 'SoapClient' not found

The weird thing is I even get this error when I try a simple php artisan to see a list of all my commands.

Why does my artisan break from this? My code works fine but artisan doesn't.

Upvotes: 0

Views: 569

Answers (1)

Magicale
Magicale

Reputation: 11

The PHP version and also the CLI ini file could be different from the web one and when running command with artisan you are using the php cli. Check with php -r "echo phpinfo();" If your php cli has soap enabled.

Upvotes: 1

Related Questions