Ghost Script Not Working isn;t working, how should I fix it?

110 Views Asked by At

I keep trying to run this block of code where it takes a PDF and then turns it into images $pdfFilePath = $_FILES['file']['tmp_name']; $imagick = new \Imagick(); $imagick->setOption('gswin64c.exe','C:\Program Files\gs\gs10.02.1\bin\gswin64c.exe'); $imagick->readImage($pdfFilePath); When I get to this line $imagick->readImage($pdfFilePath);

It returns with this error Fatal error: Uncaught ImagickException: FailedToExecuteCommand "gs" -sstdout=%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72" -dPrinted=false "-sOutputFile=C:/Users/replaced/AppData/Local/Temp/magick-8eSF0JRObHf25L8_hRwG86o77IeILqcQ%d" "-fC:/Users/replaced/AppData/Local/Temp/magick-9Uj4dmKzR7AI0hXLFmPFF2WflhBeMaFo" "-fC:/Users/replaced/AppData/Local/Temp/magick-TTHCpuykEPwnm7xV6VgHIlOs4PaVHi6-"' (The system cannot find the file specified. ) @ error/delegate.c/ExternalDelegateCommand/516 in C:\Xampp2\htdocs\Website\main.php:8 Stack trace: #0 C:\Xampp2\htdocs\Website\main.php(8): Imagick->readImage('C:\Xampp2\tmp\p...') #1 {main} thrown in C:\Xampp2\htdocs\Website\main.php on line 8`

I don't really know what it is saying, but I do know it is having some issue in finding the file! Thanks In Advance!

I tried many things like reinstalling Ghost Script, Imagick, XAMPP, and tried to find other solutions online but it didn't render much result.

0

There are 0 best solutions below