Page 1 of 1

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

Posted: 2017-09-11T02:10:07-07:00
by scrwdnet
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

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

Posted: 2017-09-11T02:19:47-07:00
by scrwdnet
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

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

Posted: 2017-09-14T00:31:20-07:00
by scrwdnet
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.

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

Posted: 2017-09-14T04:48:54-07:00
by Bonzo
Thank you for getting back with the answer scrwdent.