Answer the question
In order to leave comments, you need to log in
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}
$invoice_file = 'fileName.png';
$outvoice_file = 'fileName.tiff';
...
$img = Image::make(public_path($invoice_file))->encode('tif'); // Тут возникает ошибка
$img->save(public_path($outvoice_file));
Answer the question
In order to leave comments, you need to log in
Here you can see that you do not need to modify php.ini to install the extension in Laradock. Just in your .env
file, 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=true
and making it apt-get update
inside the container
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question