用原生 PHP 和 Js 撰寫了一個包含大約 5 個檔案的小專案。這意味著我composer.json沒有.htaccess檔案,沒有資料庫。只是對腳本(php)的 POST 請求。
嘗試在 Heroku 上部署,但不能。得到下面的錯誤
-----> Building on the Heroku-20 stack
-----> Using buildpack: heroku/php
-----> App not compatible with buildpack: https://buildpack-
registry.s3.amazonaws.com/buildpacks/heroku/php.tgz
! ERROR: Application not supported by this buildpack!
!
! The 'heroku/php' buildpack is set on this application, but was
! unable to detect a PHP codebase.
!
! A PHP app on Heroku requires a 'composer.json' at the root of
! the directory structure, or an 'index.php' for legacy behavior.
!
! If you are trying to deploy a PHP application, ensure that one
! of these files is present at the top level directory.
!
! If you are trying to deploy an application written in another
! language, you need to change the list of buildpacks set on your
! Heroku app using the 'heroku buildpacks' command.
!
! For more information, refer to the following documentation:
! https://devcenter.heroku.com/articles/buildpacks
! https://devcenter.heroku.com/articles/php-support#activation
More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
! Push failed
uj5u.com熱心網友回復:
正如錯誤訊息所說,您必須composer.json在專案的根目錄中有一個1 。
如果您沒有任何依賴項,則它可以為空:
{}
添加該檔案,提交并重新部署。
1或index.php“遺留行為”,但誰想要呢?
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/428155.html
