Skip to content Skip to sidebar Skip to footer

How Can I Fix Heroku Imagecreatefromjpeg()

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

Solution 1:

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":"*"}}

Solution 2:

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.)

Post a Comment for "How Can I Fix Heroku Imagecreatefromjpeg()"