Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Swaz's avatar
Level 20

Imagick with Ghostscript on Laravel Forge

I'm trying to use Spatie's pdf-to-image package. https://github.com/spatie/pdf-to-image

I have the following code working on local

    $pdf = new Pdf(public_path('test.pdf'));
    $pdf->saveImage(storage_path('app/public/test.jpg'));

But when I try to run that code on my Forge provisioned site I get a 500 error. Does anyone know how to get that package working?

0 likes
4 replies
marky143's avatar

Hi Swaz, how did you install it in your local?

Because I got a PHP Warning when I run php artisan serve

PHP Warning: PHP Startup: Unable to load dynamic lib rary 'C:\xampp\php\ext\php_imagick.dll' - The specified module could not be foun d.

Please or to participate in this conversation.