Reputation: 43
I'm using ImageMagick to convert a PDF file.
I use this PHP snippet:
$cadena = "/usr/local/bin/convert -density 100 -colorspace rgb ".$name_path." ".$images_path."/convert.png";
shell_exec($cadena);
where $name_path
is the PDF file directory and $images_path
is the images directory.
This code in console (CentOS) works perfectly. But when I try to use shell_exec()
function in PHP it throws this error:
***warning: considering '00000000 xxxxx n' as free entry.
*** this file had erros thah were repaired or ignored.
The permissions in file and folders are 777. I don't know why. Can somebody help me?
Upvotes: 2
Views: 276
Reputation: 90203
First of all, two observations:
So it may well be that your conversion did work and you'll have the desired output in $image_path
. Did you check?
Then, three more points:
shell_exec
. You should check that for both instances. The console command to do this is gs -version
. If you have different versions, this would explain why you do see the warning message in one instance, but not in the other.-verbose
to your commands (shell_exec
as well as in console) to see which instance of Ghostscript the IM convert
command invokes "behind your back"....Upvotes: 1