dongyongmin5711 2009-06-10 10:11 采纳率: 100%
浏览 61

为什么从PHP脚本调用(ImageMagick)convert.exe会导致页面无响应?

* This is now resolved * by clearing the temp folder in windows!

Some info - Windows 2003 server, IIS 6 ImageMagick 6.3.3 PHP 5.2.0

I am using ImageMagick to resize images on the server and I think this has recently been causing problems. What I am noticing is that when my PHP script executes the ImageMagick command the webpage freezes and will not reload. In fact I found that I have to clear the cache and cookies before I am able to reload the page and try again. Ive isolated the problem to the line of code that calls the imageMagick convert.exe. I get no response and using Mozilla Firebug to look at the traffic I can see that there is no data returned, no information about the page being called, simply it seems to hang.

The code that calls ImageMagick has not changed and has always worked previously (about 2 years!) and is as follows -

   $cmd = "convert.exe \"". $uploadfile . "\" -resize \"" . res_image_width ."x" . res_image_height . ">\" \"". $uploadfile. "\" 2>&1";
   passthru($cmd);
   //system($cmd);
   //exec($cmd);

(I have normally used passthru but I tried exec and system to see if I could return some info. )

I can run ImageMagick commands from the command line no problem and images get resized fine... so ImageMagick seems to be working fine, it just appears to be the PHP -> ImageMagick communication that is the problem. Im hoping restarting might solve it. Do you know anything else it could be? How would I go about debugging this?

many thanks

  • 写回答

1条回答 默认 最新

  • dtsnx44260 2009-06-10 10:26
    关注

    Are you able to run other commands using passthru? e.g: passthru("dir");

    And is res_image_width supposed to be $res_image_width? Make sure you have error_reporting enabled (include error_reporting(E_ALL); at the top of your script).

    评论

报告相同问题?

悬赏问题

  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 Revit2020下载问题
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大