I have a php script to convert PDF files to images using imagick.
It works on my local box but in the production server it fails to execute the command but not sure about the reason because I can't see my command execution output.
No SSH access or to the admin panel.
In order to solve this I need to know how can I log to a text file the output of this command execution in the shell from my php script, so I can after the fail download it by ftp and read it.
exec('convert -density 150 -quality 100 -sharpen 0x2.0 -background white -alpha remove ' . $file->getFileInfo()->getRealPath() . ' ' . $save_to, $result, $error);
$result
variable I tried to print_r($result);
and it just shows me Array ()
.
You can use
shell_exec()
which does same asexec()
and will outputs for you the results to check where is the error by doing it this way.