前提・実現したいこと
HEROKU や PHP や Git や Heroku CLI や notepad などを用いて BOT のシステムを作ろうとしています。だけども、エラーとみられるメッセージを受け、Heroku から動作確認がとれないでいてます。成功するとブラウザに「Hello World!」と表⽰されるのだそうですが、実現できず、ちょっとわからない状態です。始めたばっかりで知らない事ばかりです。Git リファレンス書を読んでみたりや、 notepad の文字コードを UTF-8 にしたりと、いろいろ試めすも、結局、 push のところでエラーになり、やはり動作確認がとれません。
引き続き、専門的なことを調べてみようと思いますが、すんなりとはいかないでいます。
下記の、###発生している問題・エラーメッセージ は、 buildpack heroku/php を実行したものです。
BOT 準備の動作確認したいので、スムーズに、スマートな方法ありましたら、回答していただきたく思います。よろしくお願いします。
発生している問題・エラーメッセージ
$ git push heroku master
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Writing objects: 100% (3/3), 253 bytes | 6.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/php.tgz
remote:
remote: ! 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.
remote: !
remote: ! For more information, refer to the following documentation:
remote: ! https://devcenter.heroku.com/articles/buildpacks
remote: ! https://devcenter.heroku.com/articles/php-support#activation
remote:
remote:
remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to bot-starter-.
remote:
To https://git.heroku.com/bot-starter-.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/bot-starter-.git'
以上
この度、発生している問題・エラーメッセージとなるものだと思います。
××××××@×××××× MINGW64 /c/testlinebot (master)
$ git config --global user.name "××××××"
××××××@×××××× MINGW64 /c/testlinebot (master)
$ git config --global user.email "××××××@××××××"
××××××@×××××× MINGW64 /c/testlinebot (master)
$ git config --global core.quotePath false
××××××@×××××× MINGW64 /c/testlinebot (master)
$ cd c/testlinebot
bash: cd: c/testlinebot: No such file or directory
××××××@×××××× MINGW64 /c/testlinebot (master)
$ git init
Reinitialized existing Git repository in C:/testlinebot/.git/
××××××@×××××× MINGW64 /c/testlinebot (master)
$ heroku git:remote -a bot-starter-
set git remote heroku to https://git.heroku.com/bot-starter-.git
××××××@×××××× MINGW64 /c/testlinebot (master)
$ git add .
××××××@×××××× MINGW64 /c/testlinebot (master)
$ git commit -am "shot"
On branch master
nothing to commit, working tree clean
上記が、 Heroku の Windows コマンドプロンプトから heroku login した後、 PHP の vesion を確認、 Windows の コマンドプロンプト から buildpack heroku/php を実行したものです。 その後の、GitBash を使ったものの流れです. 問題が発生するまでの流れ・手順になるんだと思っています。
### 該当のソースコード ```PHP <?php echo "Hello World!!"; ?> 上記が、notepadを使って、文字コードを UTF-8 に設定して、.PHPで保存したメモ帳の内容です。
試したこと
Gitのポケットリファレンスを専門書のつもりで購入しました。 BOT の作成方法の参考書としてや、教科書としても複数冊を読解中ではいます。
コマンドプロンプト環境設定や、 Git の設定、 notepad の保存方法などの、設定等の方をいろんな有志の方々から聞いていました。
有志の方より、回答を頼りにそれを信じ、以前の動作確認エラーメッセージから、不明な点を残しつつ理解できないままに、とりあえず buildpack heroku/php を実行しました。実行結果の意味を理解しようとすると、'composer.json' に関するメッセージと、以前の回答者の方が、必要になってくるとの、回答を思い出し、照らし合わしていました。
補足情報(FW/ツールのバージョンなど)
PHP5.6.38