投稿日:2019/5/18

[PHP-Laravel]本番サーバー構築手順(GitHub->Heroku編)


Heroku公式

https://devcenter.heroku.com/articles/getting-started-with-laravel

Heroku

https://jp.heroku.com/

Heroku クライアント

https://devcenter.heroku.com/articles/heroku-cli#windows

Git

https://gitforwindows.org/

Heroku/Application 設定

# php artisan key:generate --show の結果
# Laravel直下の.env APP_KEYと一致する必要あり
heroku config:set APP_KEY=...
# ルートディレクトリの設定
echo "web: vendor/bin/heroku-php-apache2 public/" > Procfile

Heroku/Database設定

config/database.php

'default' => env('DB_CONNECTION', 'pgsql'),

Git設定

git remote add origin https://github.com/(heroku_appname).git

リポジトリ作成・登録

git init
git add -A .
git commit -m "comment"

デプロイ

git push heroku master

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です