gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 10:23:22 24 4
gpt4 key购买 nike

目标
我对 Heroku 很陌生,我正在尝试部署一个 非常简单的网站进入 Heroku。
网站结构
enter image description here
如您所见,我并不是要在这里部署复杂的 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'

Failed to detect set buildpack https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/php.tgz



问题
我该如何绕过?
我需要在 Heroku 站点中进行任何其他设置吗?

笔记
我在这里找到了一些像这样的帖子:
Push rejected, failed to detect set buildpack heroku/php
我看了一下,但它与我这里的情况并不真正相关。

最佳答案

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

执行此操作的两种可能方法:

认识 requirementsheroku/php webpack :

  • 有一些PHP代码。例如,一个 index.php带有重定向的文件,例如:
    <?php header( 'Location: /index.html' ) ; ?>
  • 有一个 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

    关于heroku - 未能检测到 set buildpack https ://codon-buildpacks. s3.amazonaws.com/buildpacks/heroku/php.tgz,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42027973/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com