heroku推送拒绝了没有检测到index.php存在的雪松支持的应用程序


heroku push rejected no cedar-supported app detected index.php present

我正试图将我的php应用程序推送到Heroku,并得到以下错误。

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

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

到目前为止,我已经完成了以下步骤。1.我在Heroku上创建了一个应用程序-堆栈:Cedar2.git添加相关文件3.带注释的git提交4.git-push英雄大师——这家伙给了我错误。

git-ls文件列出了一个文件"index.php".

这次我错过了什么?

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

Procfile

确保Procfile:中包含以下声明

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

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

composer.json

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

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

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

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

尝试在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