Heroku 403 Forbidden Error
Ehhmm so I found the solution.
My Procfile had a .txt extension (so Procfile.txt) whereas it needs to be only Procfile.
Quit a silly mistake but I thought I should leave the answer here for future reference. Maybe it will save time from someone else.
Laravel 5.4 on Heroku. Forbidden You don't have permission to access / on this server
I don't know why the server thinks your root is at /app
but this error occurs because of the permission of the public/
directory from which Heroku is supposed to serve your application.
To resolve this issue, simply add the following to the script
section of your composer.json
"post-install-cmd": [
"php artisan clear-compiled",
"chmod -R 777 public/"
]
Note the change in permission of the public/
directory.
EDIT:
While you are at it, check your Procfile
make sure it is spelled correctly and starts with an uppercase P
.
PS: I know some people are really nitpicky and would say the permission is too lax. Yes, I agree with you. You can change it to something else like 775
let's just get the juice flowing.
Symfony on Heroku: 403 Forbidden You don't have permission to access / on this server
It is not possible. more than 3 hours to find a solution.
A solution that could not be found in all the code I posted here.
A really, simple, stupid, small solution: the procfile
name.
Are you noticing? I'm writing it all in lowercase letters.
The solution? Procfile
, with the first letter in uppercase.
It was an hell, but finally I have my app up and running! :D
Error 403: You don't have permission to access / on this server
If you are deploying php file then you need to keep php file in folder like web
and your Procfile should look like web: vendor/bin/heroku-php-apache2 web/
403 error when deploying a Node.js app on Heroku
So I finally figured it out, the solution was actually annoyingly simple. In my "/" GET route, the path contains a ..
, which was being viewed as malicious, and therefore rejected. I changed it to this:
res.sendFile(path.join(appRoot, "public/html", "index.html"));
appRoot
is a global variable that points to the root directory of the application. Hopefully this helps someone who may be having a similar issue.
Related Topics
How to Remove Back Slashes from Json Output in PHP
How to Get Previous Month from Selected Month
Displaying a Base64 Images from a Database Via PHP
How to Use Find in Set for User Rankings Based on Score
Laravel App Storage Images Failed to Load and Redirect to 404
Retrieve MySQL Value from PHP for Radio Buttons
How to Prevent SQL Injection in PHP
MySQLi or Die, Does It Have to Die
How to Show Checkboxes as Checked When Values Are Set in the Database in Laravel
How to Show Blob Image in HTML
Laravel: Products,Categories and Subcategories! (Relation Ships)
How to Pass Checkbox Value 0 If Not Checked and 1 If Checked Using Array Laravel
Laravel: Pdoexception: Could Not Find Driver
How to Fetch Data After Selecting from Dropdown List