Search code examples
phplaravelherokugd

How to install GD on Heroku


I am running Laravel 5.3 and trying to do some image manipulation. I get this error: GD Library extension not available with this PHP installation.

I've tried putting gd in my composer.json

"require": {
    "php": ">=5.6.4",
    "laravel/framework": "5.3.*",
    "mews/purifier": "~2.0",
    "vinkla/hashids": "^2.4",
    "barryvdh/laravel-debugbar": "^2.2",
    "fzaninotto/faker": "~1.4",
    "intervention/image": "^2.3",
    "gd": "*"
},

and it didn't work. I also tried:

"ext-gd": "*" 

and that didn't work either. I looked at this page https://devcenter.heroku.com/articles/php-support and it says:

The following built-in extensions have been built “shared” and can be enabled through composer.json (internal identifier names given in parentheses)

GD (gd)


Solution

  • Add "gd": "*" to composer.json and perform composer update

    If that doesn't work add "ext-gd":" *" and do a composer update