Piotr Suchanek Piotr Suchanek - 1 month ago 9x
PHP Question

Laravel custom artisan command and php extension GnuPG not found

I am making my own command in Laravel and from my Command class I call controller method. Like this:

public function fire(\BankEmailController $bankEmailController)

In checkEmails method I create new GnuPG class:

$gpg = new gnupg();

Calling the command prompt this error:

Class 'gnupg' not found


Php CLI uses other php.ini settings which I was unaware. Activeting extension in


solved the problem. After this issue I had problem, with creating Laravel classes. It was connected with the old version of Laravel 5. Solution and the related question can be found here:

Laravel 5: Using Cache:: or DB:: within the Console Kernel's schedule() function