I 'm despair...
I installed Ghostscript on Mac OS X Yosemite via Homebrew. Ghostscript works well over the shell, but it doesn't work, if it is executed via PHP.
$gs = '/usr/local/opt/ghostscript/bin/gs';
// Count PDF
$shell = $gs . ' -q -dNODISPLAY -c "(' . $pdf . ') (r) file runpdfbegin pdfpagecount = quit" 2>&1';
$result = shell_exec($shell);
// Execution
$shell = $gs . ' -dNumRenderingThreads=4 -dNOPAUSE -sDEVICE=jpeg -dFirstPage=1 -dLastPage=1 -sOutputFile="' . $filePathThumb . '" -dJPEGQ=100 -r300 -q "' . $pdf . '" -c quit 2>&1';
$result = shell_exec($shell);
The output of $result is:
dyld: Library not loaded: /usr/local/lib/libtiff.5.dylib
Referenced from: /usr/local/opt/ghostscript/bin/gs
Reason: Incompatible library version: gs requires version 8.0.0 or later, but libtiff.5.dylib provides version 7.0.0
If i execute the same command on the shell it works...
I tired so many things in the last days, but i still struggling.
I reinstalled gs and imagemagick, i removed the symlinks, runned brew doctor, tried some other libtiff.5.dyslib files.
My environment:
- Yosemite
- PHP Version 5.5.13
- Zend Server Version: 7.0.0
- Imagemagick Version 6.8.9-8 (installed via brew)
- Ghostscript Version 9.15 (installed via brew)