Skip to content

Instantly share code, notes, and snippets.

@canujohann
Last active August 29, 2015 14:01
Show Gist options
  • Save canujohann/0ad0584f8173c0e752b8 to your computer and use it in GitHub Desktop.
Save canujohann/0ad0584f8173c0e752b8 to your computer and use it in GitHub Desktop.
Laravel 4 + heroku

Herokuにlavarelアプリをデプロイ

.gitignoreの更新
  • composer.lockを.gitignoreファイルから削除
  • 'composer install'を実行
Procfile追加
web: vendor/bin/heroku-php-apache2 public
Mysql設定
$ heroku addons:add cleardb

database.php

$url = parse_url(getenv("CLEARDB_DATABASE_URL"));

$host = $url["host"];
$username = $url["user"];
$password = $url["pass"];
$database = substr($url["path"], 1);

'mysql' => array(
      'driver'    => 'mysql',
      'host'      => $host,
      'database'  => $database,
      'username'  => $username,
      'password'  => $password,
      'charset'   => 'utf8',
      'collation' => 'utf8_unicode_ci',
      'prefix'    => '',
  )
git レポの初期化
$ git init
$ git add .
$ git commit -m "Initial commit"
Herokuアプリの作成+デプロイ
$ heroku create
$ git push heroku master

DB migration

$ heroku run php /app/artisan migrate

参照

mattstauffer site

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment