【问题标题】:Failed to detect set buildpack https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/php.tgz无法检测到 set buildpack https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/php.tgz
【发布时间】:2017-02-03 15:45:38
【问题描述】:

目标

我是 Heroku 的新手,我正在尝试在 Heroku 中部署一个非常简单的网站

网站结构

如您所见,我并不想在这里部署复杂的 Node.js 或 Laravel 站点。


步骤

我当然是登录heroku,然后

cd idesign4u/
git init
heroku git:remote -a idesign4u
git add .
git commit -am "Project Initialization"
heroku buildpacks:set heroku/php

我知道了

Buildpack set. Next release on idesign4u will use heroku/php.
Run git push heroku master to create a new release using this buildpack.

我以为我已经准备好了。然后我跑了

git push heroku master

结果

我一直得到

Counting objects: 67, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (64/64), done.
Writing objects: 100% (67/67), 60.75 MiB | 6.16 MiB/s, done.
Total 67 (delta 2), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Failed to detect set buildpack https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/php.tgz
remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to idesign4u.
remote: 
To https://git.heroku.com/idesign4u.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/idesign4u.git'

未能检测到 set buildpack https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/php.tgz


问题

如何绕过它?

我需要在 Heroku 网站中进行其他设置吗?


注意

我在这里找到了一些类似这样的帖子:

Push rejected, failed to detect set buildpack heroku/php

我看了看,但在我这里并不真正相关。

【问题讨论】:

    标签: heroku


    【解决方案1】:

    您似乎正在尝试将静态网站部署到 Heroku,但指定了 heroku/php builpack,它期望... PHP 应用程序。

    两种可能的方法:

    认识heroku/php webpack 的requirements

    1. 有一些 PHP 代码。例如,带有重定向的index.php 文件,例如:

      <?php header( 'Location: /index.html' ) ; ?>

    2. 有一个composer.json 文件,可以是:

      {}

    使用heroku-buildpack-static

    这是一个用于服务静态站点的自定义 webpack。 here 提供完整指南,但重点是:

    heroku plugins:install heroku-cli-static
    heroku buildpacks:set https://github.com/hone/heroku-buildpack-static
    heroku static:init
    heroku static:deploy
    

    【讨论】:

      【解决方案2】:

      如果你将来可能想使用一些 PHP……

      1. 将您的index.html 文件更改为index.php
      2. 将您的更改提交给 master。
      3. git push heroku master

      【讨论】:

        猜你喜欢
        • 2017-01-10
        • 2016-06-22
        • 2016-10-10
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-02-14
        • 2015-10-06
        • 2016-12-04
        相关资源
        最近更新 更多