Quote from: AMDbuilder at Apr 25, 2013, 11:53 PMThose commands shouldn't be needed, we actually disable them on our servers with no adverse effects.
Actually I think they are needed for phpThumb to locate and use ImageMagick, since it runs /usr/local/bin/convert (path may differ) via a shell.
Take a look at the SafeExec() method in core/model/phpthumb/phpthumbfunctions.php (line 443):
public static function SafeExec($command) {
static $AllowedExecFunctions = array();
if (empty($AllowedExecFunctions)) {
$AllowedExecFunctions = array('shell_exec'=>true, 'passthru'=>true, 'system'=>true, 'exec'=>true);
foreach ($AllowedExecFunctions as $key => $value) {
$AllowedExecFunctions[$key] = !phpthumb_functions::FunctionIsDisabled($key);
}
}
$command .= ' 2>&1'; // force redirect stderr to stdout
foreach ($AllowedExecFunctions as $execfunction => $is_allowed) {
if (!$is_allowed) {
continue;
}
$returnvalue = false;
switch ($execfunction) {
case 'passthru':
case 'system':
ob_start();
$execfunction($command);
$returnvalue = ob_get_contents();
ob_end_clean();
break;
case 'exec':
$output = array();
$lastline = $execfunction($command, $output);
$returnvalue = implode("\n", $output);
break;
case 'shell_exec':
ob_start();
$returnvalue = $execfunction($command);
ob_end_clean();
break;
}
return $returnvalue;
}
return false;
}
Also look at the ImageMagickWhichConvert(), ImageMagickCommandlineBase() and ImageMagickVersion() methods in core/model/phpthumb/phpthumb.class.php to see how SafeExex() is used.
I've found that having ImageMagick installed is no guarantee that it's actually getting run; you need to check that specifically. You can either look at the debugmessages property of a phpThumb object right after it's run, or install the stand-alone version of
phpThumb and run phpThumb.demo.check.php to analyze your configuration.