eZ Community » Forums » Install & configuration » ez Publish 4.0.1: ImageMagick does...
expandshrink

ez Publish 4.0.1: ImageMagick does not work in ez Publish

ez Publish 4.0.1: ImageMagick does not work in ez Publish

Monday 15 December 2008 11:33:26 am - 15 replies

Hi All,
after installatin of ez Publish 4.0.1 ImageMagick does not work although it seems to be working on cmd line. The image.ini override looks like below. So as to see images I need to turn off ImageMagick.

Any idea?
Thanks a lot for your help
Anita

<?php /* #?ini charset="utf-8"?

[ImageMagick]
IsEnabled=false
ExecutablePath=/opt/local/bin
Executable=convert

[small]
Filters[]=geometry/scale=100;100

[medium]
Filters[]=geometry/scale=200;200

[large]
Filters[]=geometry/scale=300;300
*/ ?>

Monday 15 December 2008 12:16:22 pm

Hello Anita,

Did you check where is imagemagick executable like this:

whereis convert
 

Monday 15 December 2008 2:02:10 pm

Hi Ivo,
yes I did with command "which convert":
/opt/local/bin/convert

I also checked that convert is working in terminal/on command line and it does.

Thx
Anita

Monday 15 December 2008 4:05:45 pm

Then it is strange.

Look at var/log/error.log is it reporting something suspicious, maybe some problems with apache user rights on filesystem, or something similar

Monday 15 December 2008 4:17:10 pm

Hi Anita,

did you check that ezpublish is able to write on your var/ directory ?

I also notice "IsEnabled=false" instead of "IsEnabled=true"... If set to false, then ezpublish will try to use gd2.

You can also copy & paste in your command line what appears in the ezpublish debug.

Monday 15 December 2008 4:41:16 pm

Hi Arnaud,
thanks for your reply. Yes, I checked all read/write access rights on my var/ directory, and yes ImageMagick was/is enabled (sorry, copied the version where I disabled ImageMagick so as to go ahead with something else).

I receive the following error in my logs:

[ Dec 15 2008 14:16:58 ] [::1] eZImageManager::createImageAlias:
Failed converting var/ezwebin_site/storage/images/company/news/lyon-puts-europe-at-your-doorstep/913-1-eng-GB/Lyon-puts-Europe-at-your-doorstep.jpg to alias 'articlethumbnail' in directory 'var/ezwebin_site/storage/images/company/news/lyon-puts-europe-at-your-doorstep/913-1-eng-GB'

I checked the other Forum entries, tried different path settings in override image ini, but nothing seems to work.

Any other idea? Thanks for your help
Anita

Tuesday 16 December 2008 9:11:09 am

Have you tried to run a convert line in shell, just to see that convert really works?

In that way I guess you'll find out if you have permission to run convert and if the converte execute as it should.

Some easy examples can be find here:
http://www.imagemagick.org/script/convert.php

Wednesday 17 December 2008 9:34:37 am

Anita,

Afaik you should have the complete convert shell command just after the log you gave us. Running this command at the root of your ezpublish installation will give you more information.

Monday 26 January 2009 8:16:19 am

Check your php.ini configuration. I had similar problem and reason was that system function was disabled.

Monday 26 January 2009 9:16:37 am

Hi Tero,
that was a good hint. Thanks a lot, it works now. What I did:

in image.ini:
as I'm working on Mac I made sure that the executable name line for Mac was enabled:
# Name of the executable
# Executable=convert
# Name of the executable for windows,
# uncomment ExecutableMac for Mac specific converter and
# ExecutableUnix for Unix/Linux specific converter
ExecutableMac=convert

in php.ini:
I added the following line, although safe mode was off:
; When safe_mode is on, only executables located in the safe_mode_exec_dir
; will be allowed to be executed via the exec family of functions.
safe_mode_exec_dir =/opt/local/bin/

wherby /opt/local/bin is the directory where ImageMagick is installed.
And now it works.

Thanks a lot. Highly appreciated your help.
Cheers
Anita

Monday 23 February 2009 2:04:12 pm

I have problems with ImageMagick too: ezPublish doesn't show the images, as you can see from the pages below.

http://www.fclombardia.it/alfc/in...leria-di-prova/Image-with-ImageMagik
http://www.fclombardia.it/alfc/in...php?/ita/Mediateca/Galleria-di-prova (latest image: the other ones have been displayed using gd)

The settings/override/image.ini.append.php contains the following lines:

<?php /* #?ini charset="utf-8"?

[ImageMagick]
IsEnabled=true
ExecutablePath=/usr/bin
Executable=convert

*/ ?>

I get the following errors in the ez log:

Warning: PHP Feb 23 2009 13:19:48

Undefined variable: returnCode in /web/htdocs/www.fclombardia.it/home/alfc/lib/ezimage/classes/ezimageshellhandler.php on line 127

Warning: PHP Feb 23 2009 13:19:48

system() has been disabled for security reasons in /web/htdocs/www.fclombardia.it/home/alfc/lib/ezimage/classes/ezimageshellhandler.php on line 127

Warning: PHP Feb 23 2009 13:19:48

Undefined variable: returnCode in /web/htdocs/www.fclombardia.it/home/alfc/lib/ezimage/classes/ezimageshellhandler.php on line 129

Error: eZImageShellHandler(ImageMagick) Feb 23 2009 12:47:33

Unknown destination file: var/ezwebin_site/storage/images/mediateca/galleria-di-prova/image-with-imagemagik/1852-1-ita-IT/Image-with-ImageMagik_imagelarge.jpg when executing '/usr/bin/convert '-quality' '75' '-geometry' '550x730>' 'var/ezwebin_site/storage/images/mediateca/galleria-di-prova/image-with-imagemagik/1852-1-ita-IT/Image-with-ImageMagik.jpg' 'JPEG:var/ezwebin_site/storage/images/mediateca/galleria-di-prova/image-with-imagemagik/1852-1-ita-IT/Image-with-ImageMagik_imagelarge.jpg''

Error: eZImageManager::createImageAlias Feb 23 2009 12:47:33

Failed converting var/ezwebin_site/storage/images/mediateca/galleria-di-prova/image-with-imagemagik/1852-1-ita-IT/Image-with-ImageMagik.jpg to alias 'imagelarge' in directory 'var/ezwebin_site/storage/images/mediateca/galleria-di-prova/image-with-imagemagik/1852-1-ita-IT

'From the phpinfo() i see that system function is disabled.for my hosting, is there a chance to run ImageMagick i ezPublish with system disabled?

Modified on Monday 23 February 2009 2:33:11 pm by Luigi Spagnolo

Monday 23 February 2009 3:39:11 pm

SOLVED with this workaround in lib/ezimage/classes/ezimageshellhandler.php

changed

<i>system( $systemString, $returnCode );

if ( $returnCode == 0 )
{
if ( !file_exists( $destinationMimeData['url'] ) )
{
eZDebug::writeError( 'Unknown destination file: ' . $destinationMimeData['url'] . " when executing '$systemString'", 'eZImageShellHandler(' . $this->HandlerName . ')' );
return false;
}
$this->changeFilePermissions( $destinationMimeData['url'] );
return true;
}
else
{
eZDebug::writeWarning( "Failed executing: $systemString, Error code: $returnCode", 'eZImageShellHandler::convert' );
return false;
}</i>

with the following code

<i>exec( $systemString, $returnCode );

if ( $returnCode == 0 || $returnCode == null || count($returnCode)==0)
{
if ( !file_exists( $destinationMimeData['url'] ) )
{
eZDebug::writeError( 'Unknown destination file: ' . $destinationMimeData['url'] . " when executing '$systemString'", 'eZImageShellHandler(' . $this->HandlerName . ')' );
return false;
}
$this->changeFilePermissions( $destinationMimeData['url'] );
return true;
}
else
{
$returnCodeStr = implode( ' ', $returnCode);
eZDebug::writeWarning( "Failed executing: $systemString, Error code: $returnCodeStr", 'eZImageShellHandler::convert' );
return false;
}</i>

Monday 14 May 2012 1:59:48 am

Hi Luigi,

I had this problem too, and your patch fixed it. The problem seems to have started when I upgraded to PHP 5.3.8. (Three different sites running different versions of eZ experienced broken ImageMagick after the upgrade)

I'm not really a PHP programmer. Could you please tell us what your patch is doing, what the security implications are, and whether you think it should be logged as a bug with eZ.

 

regards

Paul Bolger

Modified on Monday 14 May 2012 2:05:32 am by paul bolger

Monday 07 April 2014 10:56:00 am

 Hello,

I had the same problem, I solved it by activating functions: exec system and the php.ini that have been disabled.

Please check the disabled  functions on your php.ini.

For information I use as version 2012.6 eZ Commnunity ubuntu and php 5.1.10

Thursday 10 April 2014 10:32:43 am

Did anyone open a feature request in the issue tracker to have the "exec" and "system" php functions be checked by the setup wizard?

Monday 11 September 2017 10:38:04 am

The reply has been removed because of violation of forum rules.

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from