Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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)

like image 759
niko craft Avatar asked Aug 27 '16 19:08

niko craft


People also ask

Does heroku Support PHP?

Supported versionsHeroku's PHP support extends to applications using the latest available releases in the PHP 7.4, PHP 8.0 and PHP 8.1 series.

What version of PHP does heroku use?

Confirm that your app uses one of the following supported Heroku buildpacks: PHP 5.6 - 7.3 in cedar-14. PHP 5.6 - 7.4 in heroku-16. PHP 7.1 - 8.0 in heroku-18.


2 Answers

I run composer require ext-gd and git push heroku master it did work.

I tried add "gd": "*" to composer.json and perform composer update but when push to Heroku meet error with Class 'Symfony\Component\HttpFoundation\InputBag' not found. I think it's not only update ext-gd with composer update

like image 51
minhluan2292 Avatar answered Oct 11 '22 04:10

minhluan2292


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

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

like image 32
DroidNoob Avatar answered Oct 11 '22 03:10

DroidNoob