0

I've created my first Laravel app and it works locally. The routes and controllers and stuff live in the app directory, and I see it at: http://homestead.app (I don't include /app in the url). I made it from these laracasts: https://laracasts.com/series/laravel-5-from-scratch

The problem: I've successfully deployed it to Heroku, but when I go to the root url (https://dk-laravel-test.herokuapp.com), I get a 403 error:

Forbidden

You don't have permission to access / on this server.

Clues:

  1. According to the Papertrail log, it's actually trying to go to /app/ but I'm not sure why- is that normal, or something that's inadvertently set somewhere?

    Sep 04 05:50:40 dk-laravel-test app/web.1: [Fri Sep 04 12:50:40.115461 2015] [autoindex:error] [pid 104:tid 140623923373824] [client 10.157.115.7:23446] AH01276: Cannot serve directory /app/: No matching DirectoryIndex (index.php,index.html,index.htm) found, and server-generated directory index forbidden by Options directive

  2. when I put an index.php file at the root and then try to go there directly I get a 404 (not sure if that's a clue for this or a different problem): https://dk-laravel-test.herokuapp.com/index.php

(3. I've previously added a little test php app to heroku and that served fine- nothing obvious jumps out comparing the two, but Laravel's obviously a lot fancier)

Question: where could I be accidentally telling it to go to /app/? Is that normal? Apologies if this is basic, it's my first rodeo and I've been looking around for hours

Other info/stuff I checked: - Following this article (https://mattstauffer.co/blog/installing-a-laravel-app-on-heroku), I set the BUILDPACK_URL, and in my Procfile I have:

web: vendor/bin/heroku-php-apache2 public

Any ideas? Where could I be accidentally telling it to go to /app/? Other stuff I should check? Any help is GREATLY appreciated!!

Community
  • 1
  • 1
Diane Kaplan
  • 1,626
  • 3
  • 24
  • 34

1 Answers1

1

Answer: I think this had something to do with the Procfile being inaccessible:

1) In the original case, my laravel app was one directory down in my git repo, so I think the Procfile was one level too deep to be actually found/used.

2) To verify whether that was it, I made a new (top-level) repo for a new Laravel app. I still saw the same /app/ symptom even when tweaking the Procfile(!), so I was stumped and frustrated. But this morning I updated Procfile again and pushed it to both github and heroku (should be unnecessary since I have automatic deploys set up for the master branch in that github repo), but now when I try to load it in a browser the path in the logs is (correctly) "/" instead of "/app/", so I'm finally onto the next step! (Remaining mystery that the Procfile still isn't actually listed in my github repo, but it shows up in the commit diff so the change did make it through)

So I think Procfile was it :|

Diane Kaplan
  • 1,626
  • 3
  • 24
  • 34