I'm having some problems with parentheses in a convert command string.
In a php script I build a string with imagemagick convert commands. This string is used in a php exec() call.
The string contains parentheses to group some commands. I know I have to escape the parentheses with a backslash to make it work for Linux environments.
In my PHP script I check the OS, and for Linux type systems I add backslashes to escape the parentheses. For Windows type systems I don't add the escape backslashes.
My script runs correct on both Windows and Mac, but not on a CentOS system.
In the php script I add the backslash like this:
Code: Select all
// if Linux/CentOS
$str .= " \\" . $str;
...
// run convert commands
exec($str, $output, $retval);
Does someone know how I could handle the parentheses and escaping in CentOS 6.3?
Thanks!