CentOS 7 Apache, PHP 7.4
Simple code:
$ofile = 'test.pdf';
$imagick = new Imagick();
$imagick->readImage($ofile);
I get:
Fatal error: Uncaught ImagickException: Postscript delegate failed `[ghostscript library 9.25] -sstdout=%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 '-sDEVICE=pngalpha' -dTextAlphaBits=4 -dGraphicsAlphaBits=4 '-r72x72' '-sOutputFile=/tmp/magick-16528HfVzp_FNGdCX%d' '-f/tmp/magick-16528LrkMb-C0CmIS' '-f/tmp/magick-165281qaTU7bnOBON'': ./base/gsicc_manage.c:1244: gsicc_open_search(): Could not find default_gray.icc | ./base/gsicc_manage.c:2261: gsicc_init_iccmanager(): cannot find default icc profile ./base/gsicc_manage.c:1244: gsicc_open_search(): Could not find default_rgb.icc | ./base/gsicc_manage.c:2025: gsicc_set_device_profile(): cannot find device profile **** Unable to open the initial device, quitting. @ error/ghostscript-private.h/InvokeGhostscriptDelegate/171
I try reinstall imagick. But no results...
I try:
putenv('PATH=' . getenv('PATH') . ':/usr/share/ghostscript/lib:/usr/share/ghostscript/iccprofiles:/usr/share/ghostscript/Resource/Init/');
but no results...
Please help...
DONE! The problem was in PHP Jail!