繁体   English   中英

如何修复Heroku无法识别我要部署的PHP Web应用程序

[英]How to fix Heroku not recognizing my PHP webapplication that I want to deploy

我开发了一个PHP应用程序:只是一个index.php,其中包含指向其他PHP文件的多个链接。 我们将使用它开发一个渐进式Web应用程序(PWA)。 我想在一些需要公开访问URL的Android设备上进行测试。 我想用Heroku做到这一点。

我已经设置了Heroku CLI,除了部署之外,其他所有功能都可以使用。 当我要部署时,Heroku给我一条错误消息,指出该buildpack不支持该应用程序。 当我清除构建包时,自动构建包分配流程不起作用,因为Heroku无法识别语言。

ERROR: Application not supported by this buildpack!
remote:  !
remote:  !     The 'heroku/php' buildpack is set on this application, but was
remote:  !     unable to detect a PHP codebase.
remote:  !
remote:  !     A PHP app on Heroku requires a 'composer.json' at the root of
remote:  !     the directory structure, or an 'index.php' for legacy behavior.
remote:  !
remote:  !     If you are trying to deploy a PHP application, ensure that one
remote:  !     of these files is present at the top level directory.
remote:  !
remote:  !     If you are trying to deploy an application written in another
remote:  !     language, you need to change the list of buildpacks set on your
remote:  !     Heroku app using the 'heroku buildpacks' command. 

但是:我已经为Heroku设置了一个-empty- composer.json ,并且我已经有了一个index.php

我不知道哪里出了问题。

已经制作了一个composer.json文件和composer.lock来适应Heroku在错误消息中概述的问题。

原来我还没有完全理解我的git push命令。

我正在命令: git push heroku master 我的想法是:我当前的分支正被推送到Heroku的主分支。 这似乎是不正确的。 实际上: git push heroku master意味着您将本地master推送到远程master。 我当地的master是空的。

因此,我将命令更改为git push heroku dev:master以指定应将哪个本地分支转到远程分支。 这不是最佳实践,但它是一个测试应用程序,因此是一个不错的解决方案。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM