How can I fix Heroku imagecreatefromjpeg ()

heroku tell me the error: call the undefined function imagecreatefromjpeg () .. at line 177, where on line 177: case 'jpg': case 'jpeg': $ image_data = imagecreatefromjpeg ($ src_image); break;

I think hero doesn't support jpeg or something else, what can I do in this case?

+3


source to share


2 answers


You will need to use your own buildpack with imagick or gd compilation.

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



See https://github.com/winglian/heroku-buildpack-php (This version builds on top of 5.4.11 using PHP-FPM, but you can select the older tagged branch for 5.3 support with mod_php.)

+1


source


In Heroku, GD is a "generic" extension that you can include in composer.json. No custom buildpack required, just add the ext-gd line to composer.json

:



{
  "require": {
    "ext-gd": "*"
  }
}

      

+6


source







All Articles