在Joomla中使用exec PHP执行ImageMagick

时间:2014-05-31 10:39:57

标签: php joomla imagemagick exec

我有以下代码:

...
$last_id = $row->id;

$justname2 = pathinfo($_FILES["pdf"]["name"], PATHINFO_FILENAME);
$input2 = "C:/wamp/www/apuntes/components/com_djclassifieds/images/item/WM_".$_FILES["pdf"]["name"];
$output2 = "C:/wamp/www/apuntes/components/com_djclassifieds/images/item/".$last_id."_".$justname2.".png";
$justname3 = $last_id."_".$justname2;

exec('C:\"Program Files"\ImageMagick-6.8.9-Q16\convert -density 400 '.$input2.'[0] -resize 25% '.$output2);

它在我的Wamp服务器上完美运行。

问题是当我将其上传到真实服务器时,因为我没有C中的ImageMagick,但在/ libraries中。所以我尝试了这个:

exec(JPATH_ROOT."/libraries/ImageMagick-6.8.9-Q16/convert -density 400 ".$input2." -resize 25% ".$output2);

但它不起作用。还尝试了JPATH_SITE。

我不得不说服务器上没有安装ImageMagick,我只是上传了安装文件夹。

任何有用的线索或建议?

0 个答案:

没有答案