【问题标题】:elastic beanstalk linux php GD library error on imagerotateimagerotate上的弹性beantalk linux php GD库错误
【发布时间】:2014-06-12 02:39:32
【问题描述】:

我已经在我的 MAMP 和 Lamp 站点上运行以下 imagerotate 代码很长时间了(Lamp 在 AWS EC2 微实例上),没有任何问题。

...

case 6 :
// 90 rotate right
$destinationImage = imagerotate($destinationImage, -90, -1);
$this -> log -> lwrite('90 rotate right');
$this -> log -> lwrite(var_export($destinationImage, true));
break;

....
return imagejpeg($destinationImage, $destination, 100);

我刚刚迁移到 elastic beanstalk,并使用 eb tools 和 eb aws.push 从 git 进行部署。

自从将此推送到 ELB 后,我在日志中看到以下错误

PHP Warning:  imagejpeg() expects parameter 1 to be resource, boolean given in /var/app/current/util/ImageUtil.class.php on line 221

这告诉我 imagerotate 由于某种原因无法正常工作并返回 false。我的正常日志记录抽出:

[26/Apr/2014:09:34:15] (image_upload) [2-f9skfpbrbdi36kdvr42gh3tt71] : 90 rotate right
[26/Apr/2014:09:34:15] (image_upload) [2-f9skfpbrbdi36kdvr42gh3tt71] : false

这是弹性豆茎的已知问题吗?有什么建议吗?

【问题讨论】:

    标签: php linux amazon-web-services amazon-elastic-beanstalk


    【解决方案1】:

    这不一定是亚马逊的错误。

    我发现使用 -1 的 imagerotate 调用失败了。

    $destinationImage = imagerotate($destinationImage, -90, -1);
    

    而使用 0 的版本有效

    $destinationImage = imagerotate($destinationImage, -90, 0);
    

    【讨论】:

      猜你喜欢
      • 2012-05-15
      • 2019-08-07
      • 1970-01-01
      • 1970-01-01
      • 2019-06-18
      • 2023-03-15
      • 2021-11-20
      • 2016-04-15
      • 2018-09-10
      相关资源
      最近更新 更多