Heroku - how to enable gd on heroku php application?

回眸只為那壹抹淺笑 提交于 2019-11-30 16:27:49

问题


Heroku said:

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

But it doesn't give an example, I tried with the following composer.json: { "require": { "gd": "*" } }

But when I git push heroku master, I get:

My composer.json: { "require": { "gd": "*" } }

But when I git push heroku master, I get:

-----> Installing dependencies...
       Composer version 1.0.0-alpha9-19-g10401d5 2014-12-09 11:32:02
       Loading composer repositories with package information
       Installing dependencies
       Your requirements could not be resolved to an installable set of packages.

         Problem 1
           - The requested package gd could not be found in any version, there may be a typo     in the package name.

       Potential causes:
        - A typo in the package name
        - The package is not available in a stable-enough version according to your minimum-    stability setting
          see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.

       Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

 !     Push rejected, failed to compile PHP app

How can I enable gd on heroku???


回答1:


Try it with:

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

see here using-optional-extensions




回答2:


Just adding GD as dependency (require) in composer does not load the extension GD. It just tells that this package needs gd enabled. "ext-gd" is just a virtual package, not existing for real.

you have to install it on your platform.

see here composer - platform-packages



来源:https://stackoverflow.com/questions/27380365/heroku-how-to-enable-gd-on-heroku-php-application

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!