簡體   English   中英

推送被拒絕,未能檢測到set buildpack heroku / php

[英]Push rejected, failed to detect set buildpack heroku/php

我正在嘗試將我的php應用程序從github部署到heroku,但它不起作用。 我有將php應用程序部署到heroku的經驗,但出於某種原因,這次我遇到了麻煩。

這就是我所做的。

  1. 在heroku中創建了一個應用程序
  2. 將我的github鏈接到我的heroku app
  3. 從我的本地目錄添加了一個遠程到heroku應用程序
  4. 將buildpack設置為php
  5. 運行git push heroku master

我的目錄包含以下文件:

home.html
index.php
index.css

這是我的index.phpPush rejected, failed to detect set buildpack heroku/php

這是我在第5步之后得到的:

Counting objects: 52, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (48/48), done.
Writing objects: 100% (52/52), 1.12 MiB | 1.23 MiB/s, done.
Total 52 (delta 20), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Using set buildpack heroku/php
remote:
remote:  !     Push rejected, failed to detect set buildpack heroku/php
remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote:
remote: Verifying deploy....
remote:
remote: !   Push rejected to appp.
remote:
To https://git.heroku.com/appp.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/appp.git'

這是我的heroku logs

2015-11-19T00:22:31.307947+00:00 heroku[api]: Set BUILDPACK_URL config vars by email@gmail.com
2015-11-19T00:22:31.307947+00:00 heroku[api]: Release v3 created by email@gmail.com
2015-11-19T00:22:43.284779+00:00 heroku[slug-compiler]: Slug compilation started
2015-11-19T00:22:43.284789+00:00 heroku[slug-compiler]: Slug compilation failed: failed to detect set buildpack heroku/php
2015-11-19T00:22:43.284790+00:00 heroku[slug-compiler]: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
2015-11-19T00:27:00.648462+00:00 heroku[api]: Starting process with command `false && AUTOMATED DIAGNOSIS BEING RUN BY HEROKU SUPPORT; cat Procfile` by email@gmail.com
2015-11-19T00:27:01.379352+00:00 heroku[run.2268]: Awaiting client
2015-11-19T00:27:01.441226+00:00 heroku[run.2268]: Starting process with command `false && AUTOMATED DIAGNOSIS BEING RUN BY HEROKU SUPPORT; cat Procfile`
2015-11-19T00:27:01.858759+00:00 heroku[run.2268]: State changed from starting to up
2015-11-19T00:27:03.971434+00:00 heroku[run.2268]: Process exited with status 1
2015-11-19T00:27:03.989162+00:00 heroku[run.2268]: State changed from up to complete
2015-11-19T00:30:14.310979+00:00 heroku[slug-compiler]: Slug compilation started
2015-11-19T00:30:14.310987+00:00 heroku[slug-compiler]: Slug compilation failed: failed to detect set buildpack heroku/php
2015-11-19T00:30:14.310988+00:00 heroku[slug-compiler]: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
2015-11-19T00:31:54.735764+00:00 heroku[slug-compiler]: Slug compilation started
2015-11-19T00:31:54.735775+00:00 heroku[slug-compiler]: Slug compilation failed: failed to detect set buildpack heroku/php
2015-11-19T00:31:54.735776+00:00 heroku[slug-compiler]: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
2015-11-19T00:34:31.326372+00:00 heroku[slug-compiler]: Slug compilation started
2015-11-19T00:34:31.326383+00:00 heroku[slug-compiler]: Slug compilation failed: failed to detect set buildpack heroku/php
2015-11-19T00:34:31.326385+00:00 heroku[slug-compiler]: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
2015-11-19T00:34:37.003934+00:00 heroku[slug-compiler]: Slug compilation started
2015-11-19T00:34:37.003944+00:00 heroku[slug-compiler]: Slug compilation failed: failed to detect set buildpack heroku/php
2015-11-19T00:34:37.003946+00:00 heroku[slug-compiler]: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure

在我的情況下,我需要在我的git文件夾所在的同一目錄中有一個composer.json文件。 在嘗試執行git push heroku master之前,還要確保在提交中包含了json文件。

我的composer.json文件只包含這個,所以它是一個有效的json。

{}

我發現了什么是錯的。 在我的git repo中,我有一個單獨的文件夾,其中包含顯示網站的所有html和php文件。 一旦我將它們移動到主目錄,heroku就能夠檢測到它是一個php應用程序。

請確保您執行以下操作。

  • 使用一些測試數據創建index.html。
  • 創建在文件中只有{} composer.json
  • 創建index.php具有<?php include_once("index.html"); ?> <?php include_once("index.html"); ?>
  • 現在提交這些並使用此命令git push heroku master

所有文件都應該在同一目錄中。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM