How can I fix Heroku imagecreatefromjpeg()

后端 未结 2 611
自闭症患者
自闭症患者 2021-01-13 19:38

heroku report me a error: Call to undefined function imagecreatefromjpeg() ..at line 177, where at line 177 is: case \'jpg\': case \'jpeg\': $image_data = imagecreatefromjp

相关标签:
2条回答
  • 2021-01-13 20:04

    On Heroku, GD is a "shared" extension that you can enable in composer.json. No custom buildpack required, just add the ext-gd line in your composer.json:

    {
      "require": {
        "ext-gd": "*"
      }
    }
    
    0 讨论(0)
  • 2021-01-13 20:07

    You'll need to use a custom buildpack with imagick or gd compiled in.

    I don't believe the latest version of heroku's official PHP buildpack has support for this, but I've created my own buildpacks for this too.

    See https://github.com/winglian/heroku-buildpack-php (This version is built on 5.4.11 using PHP-FPM, but you can choose an older tagged branch for 5.3 support using mod_php.)

    0 讨论(0)
提交回复
热议问题