Closed miro-ux closed 2 years ago
What do you get if you run "which convert" on your server via SSH?
What do you get if you run "which convert" on your server via SSH?
/usr/bin/convert
And can you confirm that your web server allows PHP to run executables?
Yes. Here's a simple test on the same server and domain i'm testing the plugin on.
In fact, I was able to get it to work and save the CLI mode by commenting both is_executable
checks.
/*
* ImageMagick executable handling
*/
// Do we have a valid ImageMagick executable set?
function ime_im_cli_valid() {
$cmd = ime_im_cli_command();
return !empty($cmd); //&& @is_executable($cmd);
}
// Test if we are allowed to exec executable!
function ime_im_cli_check_executable($fullpath) {
if (!@is_executable($fullpath)) {
//return false;
}
@exec( "$fullpath --version", $output );
ime_set_option( 'imagemagick_version', $output, true );
return (is_array($output)) ? (count( $output ) > 0) : false;
}
My humble guess is that is_executable
checks for something else that exec
isn't influenced by.
I have no idea why...
Found this answer. It's is a good alternative to is_executable
which works without issues for me.
Here's the final code:
/*
* ImageMagick executable handling
*/
// Do we have a valid ImageMagick executable set?
function ime_im_cli_valid() {
$cmd = ime_im_cli_command();
return !empty($cmd) && `which $cmd`;
}
// Test if we are allowed to exec executable!
function ime_im_cli_check_executable($fullpath) {
if (!`which $fullpath`) {
return false;
}
@exec( "$fullpath --version", $output );
ime_set_option( 'imagemagick_version', $output, true );
return (is_array($output)) ? (count( $output ) > 0) : false;
}
Thank you, will be implemented in next release
https://github.com/orangelabweb/imagemagick-engine/commit/c5ff73718a5db21253c070330b5597c81715350e
I couldn't set the engine to cli.
imagemagick
is installed andconvert
is working via SSH.The problem seems to be that
!@is_executable($fullpath)
returns false even thought convert is set to 777.Commenting out the check seems to fix the issue and it works/resizes as expected:Edit : Commenting out the check passes the test button but upon saving it revers to PHP module.Is this just me? Can you reproduce?
Ubuntu: 18.04.6 PHP: 7.2.24 ImageMagick: 6.9.7-4