Forums / Install & configuration / Problem with image magick convert adding backslash

Problem with image magick convert adding backslash

Author Message

Jean-Francois Lalande

Saturday 08 August 2009 4:48:57 am

Hello,

I cannot execute the convert command for image convertion. I obtain this in the debug info:

Failed executing: /usr/local/bin/convert '-geometry' '600x600>' 'var/plain_site/storage/images/media/images/diagramme2/272-1-fre-FR/Diagramme2.png' 'PNG:var/plain_site/storage/images/media/images/diagramme2/272-1-fre-FR/Diagramme2_reference.png'

I suspected the configuration of PHP and I checked the safe_mode which is enabled. I made a link to convert and authorized php to execute convert.

But in the apache's logs, I obtained this:

convert: invalid argument for option `600x600\>': -geometry.

So I made a small script of test:
<?
exec("/usr/local/bin/convert '-geometry' '600x600>' logo.jpg out.jpg");
?>

that produced the same error. It seems that php (or apache ?) is adding a backslash in front of the > that is used by ezpublish.

Maybe someone knows how to setup correctly apache/php or Ezpublish to avoid this problem. Maybe this is a problem to include somewhere in the documentation/faq of Ezpublish.

Any help is appreciated :)

Jean-Francois.

Jean-Francois Lalande

Saturday 08 August 2009 7:02:22 am

I think maybe this is not a problem with Apache and PHP. The documentation of exec indicates that "With safe mode enabled, the command string is escaped with escapeshellcmd(). Thus, echo y | echo x becomes echo y \| echo x.". So maybe it is a bug of Ezpublish that sends a commande line with a ">" inside which is escaped with a "\".

Can anyone confirm this ?

If it is right I can submit a bug report.

Peter Keung

Saturday 08 August 2009 9:00:49 am

Actually, the best solution is to disable safe mode, since that is one of the eZ Publish requirements:

http://ez.no/ezpublish/requirements

Most likely, this has to be set in php.ini or httpd.conf and cannot be done in .htaccess

http://www.mugo.ca
Mugo Web, eZ Partner in Vancouver, Canada