2015-11-19 17 views
8

Tôi đang cố triển khai ứng dụng php của mình từ github đến heroku, nhưng nó không hoạt động. Tôi đã có kinh nghiệm với việc triển khai các ứng dụng php cho heroku, nhưng vì một lý do nào đó, tôi gặp rắc rối lần này.Đẩy bị từ chối, không phát hiện được tập hợp buildpack heroku/php

Đây là những gì tôi đã làm.

  1. Tạo một ứng dụng trong Heroku
  2. Liên Kết github của tôi để ứng dụng Heroku tôi
  3. Added khiển từ xa để ứng dụng Heroku từ thư mục địa phương của tôi
  4. Set buildpack để php
  5. Run git push heroku master

Thư mục của tôi có các tệp sau:

home.html 
index.php 
index.css 

Dưới đây là tôi index.php: Push rejected, failed to detect set buildpack heroku/php

Đây là những gì tôi đã nhận sau khi bước 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' 

Đây là tôi heroku logs:

2015-11-19T00:22:31.307947+00:00 heroku[api]: Set BUILDPACK_URL config vars by [email protected] 
2015-11-19T00:22:31.307947+00:00 heroku[api]: Release v3 created by [email protected] 
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 protected] 
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 

Trả lời

0

tôi phát hiện ra những gì đã sai. Trong repo git của tôi, tôi đã có một thư mục riêng biệt có tất cả các tệp html và php sẽ hiển thị trang web. Khi tôi chuyển chúng ra thư mục chính, heroku đã có thể phát hiện ra rằng đó là một ứng dụng php.

+2

bạn sẽ xin hãy giải thích đồng thời chỉ rõ là những gì cấu trúc thư mục mới sau khi sửa chữa? Tôi sẽ giúp –

13

Trong trường hợp của tôi, tôi cần có tệp composer.json trong cùng thư mục chứa thư mục git của tôi. Ngoài ra hãy chắc chắn rằng bạn đã bao gồm tệp json trong cam kết của bạn trước khi cố gắng làm git đẩy chủ nhân heroku.

Tệp composer.json của tôi chỉ chứa tệp này để nó là một json hợp lệ.

{}

+0

Nếu tôi không có composer.json thì sao? Tôi có cần tạo một cái không? Ứng dụng của tôi rất đơn giản, chỉ cần 1 index.html và 1 tệp css ... – ihue

Các vấn đề liên quan