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

2022-08-30 14:48:32

赫罗库 说:

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

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

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

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


答案 1

试试看:

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

使用可选扩展看到这里


答案 2

只是在作曲家中添加GD作为依赖项(必需)不会加载扩展GD。它只是告诉这个包需要启用gd。“ext-gd”只是一个虚拟的包,不是真实存在的。

您必须将其安装在您的平台上。

请参阅此处编辑器 - 平台包


推荐