I want to create an image from a pdf file. I have installed ImageMagick on a Linux server and successfully created an image from a terminal with root access.
Command:
/usr/local/bin/convert http://www.artisticancestry.com/sites/default/files/media/Getting%20Started_7.pdf /public_html/testing.png
But When i am going to execute this command from php exec() function. It is showing this type of error
error: convert: unable to open image /public_html/testing-0.png': No such file or directory @ error/blob.c/OpenBlob/2642. convert: WriteBlob Failed
/public_html/testing-0.png' @ error/png.c/MagickPNGErrorHandler/1751.
There is some permission issue but don't know which file has no permission.How can I find out what is causing this problem and how can I solve it?
I had the same problem. The issue was a wrong folder name. You need to use the full path to the file from the system root, or relative path without / as first symbol.
It was a permission issue for me
chmod -R 777 /dir
/dir = Directory where you want to writing your image
It was a permission issue for me too.
I give the full permission to the cache
folder which was present inside tcpdf
folder.
chmod 0777 -R cache/