D
D
devAston2019-08-08 13:27:14
PHP
devAston, 2019-08-08 13:27:14

How to properly configure php.ini in Docker?

When processing a queue in Laravel, it throws an error in the logs:

[2019-08-08 09:49:44] local.ERROR: ImageMagick module not available with this PHP installation. {"exception":"[object] (Intervention\\Image\\Exception\\NotSupportedException(code: 0): ImageMagick module not available with this PHP installation. at /var/www/vendor/intervention/image/src/Intervention/Image/Imagick/Driver.php:20)
[stacktrace]
#0 /var/www/vendor/intervention/image/src/Intervention/Image/ImageManager.php(112): Intervention\\Image\\Imagick\\Driver->__construct()
#1 /var/www/vendor/intervention/image/src/Intervention/Image/ImageManager.php(54): Intervention\\Image\\ImageManager->createDriver()
#2 /var/www/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(237): Intervention\\Image\\ImageManager->make('/var/www/public...')
...
#33 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(133): Illuminate\\Console\\Application->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#34 /var/www/artisan(37): Illuminate\\Foundation\\Console\\Kernel->handle(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#35 {main}

One of the queued task methods is to process the image.
$invoice_file = 'fileName.png';
$outvoice_file = 'fileName.tiff';
...
$img = Image::make(public_path($invoice_file))->encode('tif'); // Тут возникает ошибка
$img->save(public_path($outvoice_file));

How to properly configure php.ini in Docker in order for extensions to work from under CLI mode?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Bratenkov, 2019-08-08
@devAston

Here you can see that you do not need to modify php.ini to install the extension in Laradock. Just in your .envfile, replace
With
Then rebuild the container: docker-compose build.
PS: Specifically, with imagemagick, laradock has some problems ( more ), if after restarting the extension does not work, try installing WORKSPACE_INSTALL_DUSK_DEPS=trueand making it apt-get updateinside the container

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question