Heroku - 如何在heroku php应用程序上启用gd?

时间:2014-12-09 13:42:43

标签: php heroku gd

Heroku说:

  

以下内置扩展已经构建为“共享”,可以通过composer.json(括号中给出的内部标识符名称)启用:

但它没有给出一个例子,我尝试使用以下composer.json: { "require": { "gd": "*" } }

但是当我git push heroku master时,我得到了:

  

我的composer.json:    { "require": { "gd": "*" } }

但是当我git push heroku master时,我得到了:

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

如何在heroku上启用gd ???

2 个答案:

答案 0 :(得分:45)

尝试使用:

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

using-optional-extensions

答案 1 :(得分:3)

在编辑器中添加GD作为依赖(require)不会加载扩展GD。它只是告诉这个包需要启用gd。 &#34; EXT-GD&#34;只是一个虚拟包,不是真实的。

您必须在平台上安装

composer - platform-packages