How to setup Laravel Application on Heroku

Server Setup

  • Make sure Required packages are in "require": {
    brew install heroku/brew/heroku
    heroku login
  • Make sure composer, php and git commands working
  • Go inside Laravel Project and create Procfile
    echo "web: vendor/bin/heroku-php-apache2 public/" > Procfile
    git add Procfile
    git commit -m "Procfile for Heroku"
  • Create Heroku Server
    heroku create laplus-heroku
    heroku buildpacks:set heroku/php
    heroku config:set APP_KEY=$(php artisan --no-ansi key:generate --show)
  • go to config/app.php and set 'log'=>'errorlog'
    git commit -m "Heroku app is ready"
    git push heroku master --app laplus-heroku
  • Start server
    heroku open --app laplus-heroku

2. Database Setup

Share

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.