steven
steven

Reputation: 191

Procfile not found when deploying app to heroku

When deploying my laravel application to heroku i get a fail of Procfile not found. How do I create this? and what does this file need to have. I can't access the app via the browser because of the 403 forbidden error.

The exact error message when pushing files to heroku:

NOTICE: No Procfile, using 'web: vendor/bin/heroku-php-apache2'.

Upvotes: 2

Views: 8382

Answers (3)

maswerdna
maswerdna

Reputation: 315

The following points are important to avoid this error:

  1. Create a Procfile in the root directory of your Laravel app. You can either create this from your IDE or through CLI by running the following command:
echo "web: vendor/bin/heroku-php-apache2 public/" > Procfile

without the quotes.

echo web: vendor/bin/heroku-php-apache2 public/ > Procfile
  1. The name of the file is caseSensitive in ucfirst format.
  2. You need to push to heroku master while you are on your local master branch.

To push from another local branch, run the following command:

git push heroku your-local-branch:master

So, if you're pushing from the local-dev branch, you should run:

git push heroku local-dev:master

Upvotes: 0

Hedegare
Hedegare

Reputation: 2047

A Procfile is a file named Procfile and is a mechanism for declaring what commands are run by your application’s dynos on the Heroku platform. So you need to create a file on your public directory, name it Procfile and add the following:

web: vendor/bin/heroku-php-apache2

After this save it and upload it to your server.

Upvotes: 6

Peter Reshetin
Peter Reshetin

Reputation: 925

Create it with these commands:

echo web: vendor/bin/heroku-php-apache2 public/ > Procfile
git add .
git commit -m "Procfile for Heroku"

Upvotes: 6

Related Questions