6

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_image); break;

I think heroku does not support jpeg or something, what can I do in that case?

Pustiu314p
  • 63
  • 3

2 Answers2

9

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": "*"
  }
}
amacrobert
  • 2,707
  • 2
  • 28
  • 37
1

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

Wing Lian
  • 2,387
  • 16
  • 14
  • thank you for your response. only need to push buildpack to server? sorry I;m not experienced with that. – Pustiu314p Feb 13 '13 at 10:33
  • I had incorrectly linked to the official heroku buikdpack and not the custom one. How to configure your app to use it is in the README. You may have to make a small edit and git push to heroku after configuring the buuldpack. – Wing Lian Feb 13 '13 at 16:07
  • Thank you, I succeeded with that, now I have another problem with: Warning: session_start(): Cannot find serialization handler 'igbinary' which really do not know what that means – Pustiu314p Feb 14 '13 at 21:55
  • You can add [imagick.so as an extension](https://github.com/alkhoo/heroku-cedar-php-extension) – Alvin K. Apr 30 '13 at 07:35
  • @Pustiu314p - Can you upload your solution I have the same issue. – Rails beginner Jul 10 '13 at 09:09