I have a basic Laravel 7.x application that I'm trying to deploy to production using Vapor. when it reaches the Running Deployment Hooks
section of deployment it fails with the following message.
An error occurred during deployment.
Message: Deployment hook failed.
A deployment hook failed. You may review its logs using the hook:log command.
I checked the logs for more details and it suggests there is an issue with imagick
Loaded Composer autoload filePreparing to add secrets to runtimePreparing to boot FPMEnsuring ready to start FPMStarting FPM Process...[14-Sep-2020 00:57:50] NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library 'imagick' (tried: /opt/bin/imagick (/opt/bin/imagick: cannot open shared object file: No such file or directory), /opt/bin/imagick.so (libMagickWand.so.5: cannot open shared object file: No such file or directory)) in Unknown on line 0
You can add it like this in your vapor.yml:
Source: https://blog.laravel.com/vapor-adding-imagick-as-a-separate-lambda-layer