Error "FailedToExecuteCommand `'gs' ...` @error/pdf.c/InvokePDFDelegate/291

IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
Post Reply
scrwdnet
Posts: 3
Joined: 2017-09-11T01:59:57-07:00
Authentication code: 1151

Error "FailedToExecuteCommand `'gs' ...` @error/pdf.c/InvokePDFDelegate/291

Post by scrwdnet » 2017-09-11T02:10:07-07:00

I'm getting the above error when I try to run the below line of code:

Code: Select all

new Imagick("/Users/scrwdnet/Desktop/DEVELOPMENT/Safe/system/storage/medialibrary/temp/8Y1yyIbiUjuPAjcVIbYpGByEYCpCBahB/RW0tlWRLbO4lasmJ.pdf");
When I run exactly the same line through the command line (php -a) it works fine, the PHP version and source is the same in both command line and 'in app' using (Laravel Valet, runs on NGINX).

Has anyone come across this issue before or am I missing something obvious.

PHP 7.1, ImageMagick 7.0.7-1, GhostScript 9.21 all installed through HomeBrew, ImageMagick installed via php71-imagick

Thanks

scrwdnet
Posts: 3
Joined: 2017-09-11T01:59:57-07:00
Authentication code: 1151

Re: Error "FailedToExecuteCommand `'gs' ...` @error/pdf.c/InvokePDFDelegate/291

Post by scrwdnet » 2017-09-11T02:19:47-07:00

I'm addition to this running:

Code: Select all

shell_exec("gs -v")
Prints out the correct GhostScript details etc, so it doesn't seem to be an issue with GS not being available to NGINX. :/

Thanks

scrwdnet
Posts: 3
Joined: 2017-09-11T01:59:57-07:00
Authentication code: 1151

Re: Error "FailedToExecuteCommand `'gs' ...` @error/pdf.c/InvokePDFDelegate/291

Post by scrwdnet » 2017-09-14T00:31:20-07:00

It did turn out to be an issue with the server not being able to access GS.

This question was pointed out to me by another developer: https://stackoverflow.com/a/37932296/7468785

The symlink fixed it right away.

Bonzo
Posts: 2844
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Error "FailedToExecuteCommand `'gs' ...` @error/pdf.c/InvokePDFDelegate/291

Post by Bonzo » 2017-09-14T04:48:54-07:00

Thank you for getting back with the answer scrwdent.

Post Reply