I realize that Imagick has it's own command line executables, but why whenever I try to run an Imagick command written in PHP it breaks my script and exits without warning?
Take something simple:
<?php
$imagepath = realpath('1.gif');
var_dump('111');
$image = new Imagick($imagepath);
var_dump('222');
var_dump($image);
Running php -f imagick.php
on my command line interface just simply outputs string(3) "111"
and then immediately exits once it hits any Imagick function.
Imagick is properly installed on my machine, and if I do a php -m
it shows Imagick as an installed module.
Is there anyway to get it working in command line scripts (aside from using exec()
)?
I was slightly worried that it wouldn't work on cron jobs, but I just did a quick test and it seems to be working within that (least on VPS).
Am trying from Windows x64 WAMP server PHP v7.1.16.
Note: To clarify, this is just a command line issue. Imagick is installed correctly, no issue with syntax, I've been using it for months in the browser with no issues.
Even command line attempts.. php -d display_errors imagick.php
, same, dies upon impact of IM with no notice php -n -l -d display_errors -d display_startup_errors imagick.php
brings back 'No Syntax Errors'. It's peculiar, nothing should simply kill the script (although it does try to load for a second before it essentially breaks out of the script no matter where it's at) without any notice.. then again since there's no issue running it in the browser over and over, so I don't think there is any errors (especially sampling my above one liner Imagick initalization).. it's just a CLI thing that I do not understand.