【问题标题】:heroku push rejected no cedar-supported app detected php - index.php presentheroku push 拒绝没有检测到支持 cedar 的应用程序 php - index.php 存在
【发布时间】:2013-09-07 17:35:42
【问题描述】:

我正在尝试将我的 php 应用程序推送到 Heroku 并收到以下错误。

Heroku 接收推送 ! Heroku 推送被拒绝,未检测到 Cedar 支持的应用程序。

我已经阅读了所有以前的帖子,这些帖子说 PHP 应用程序应该在根文件夹中有一个 index.php ......我这样做了。当我执行“git ls-files”时,我会列出 index.php(名称为小写)。

到目前为止我执行的步骤是。 1. 我在 Heroku 上创建了一个应用程序 - stack:Cedar 2.git添加相关文件 3. 带有注释的 git commit 4. git push heroku master -- 这家伙给了我错误。

git ls-files 列出一个文件“index.php”。

这次我错过了什么?

【问题讨论】:

  • 您确定该应用程序不在子目录中吗?我曾经在使用 Rails 应用时遇到过这个问题。
  • @apfel 您能否更具体地说明您不在子目录中的意思?我可以使用任何命令来查找/确认这一点吗? git ls-files 的输出是 channel.html file.txt images/Background.png images/BannerText.png index.php utils.php 这有帮助吗?
  • 运行ls -la 并确保.git 目录与index.php 文件位于同一文件夹中。
  • @apfel...那也没用。
  • @apfel... 在同一个目录中拥有 index.php 和 .git 并没有帮助 ls -la 给出输出,但 push 给出了同样的错误。 . .. .DS_Store .git .project ContactUs.html MyApp.php PrivacyPolicy.html Test.html Themes-backup channel.html file.txt 图片 index.php sdk Themes txt.txt utils.php

标签: php heroku


【解决方案1】:

我刚开始使用 Heroku,遇到了同样的问题。下面是我做错了什么的描述。

过程文件

确保您的Procfile 中包含以下语句:

web: vendor/bin/heroku-php-apache2 path/to/web/

其中path/to/web/ 是您要在网络上公开公开的目录的相对路径。确保公共目录包含一个index.php 文件(例如path/to/web/index.php)。

composer.json

在您的 composer.json 目录(应该在存储库的基本目录中)确保包含 Heroku PHP buildpack。

{
  "require": {

  },
  "require-dev": {
    "heroku/heroku-buildpack-php": "*"
  }
}

如果缺少此语句,则运行composer update(对我来说是./composer.phar update,因为我下载了composer并将其放置在我的存储库的基本目录中)以便Composer获取包并将其安装到您的@987654330 @目录。

【讨论】:

    【解决方案2】:

    尝试在你的 heroku 工具带上运行它

    > heroku config:set BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-php
    > git add .
    > git git commit -am "add composer.json for PHP app detection"
    > git push / git push heroku master
    

    【讨论】:

      【解决方案3】:

      问题在于 .git 目录不正确/不完整。删除旧的并重新创建它(git init)解决了这个问题。

      【讨论】:

        猜你喜欢
        • 2013-03-08
        • 2013-02-03
        • 2014-09-23
        • 1970-01-01
        • 2012-03-07
        • 2012-01-11
        • 2014-04-22
        • 2012-12-05
        • 2014-11-09
        相关资源
        最近更新 更多