HTTP 500 Error: site.com is currently unable to handle this request
I'm in the process of deploying my first Laravel app to a DigitalOcean server by means of git hooks. I've got the whole file-structure over on the server I want. Nginx is up and running--plugging in the IP of the server yields the standard nginx greeting page. Postgresql is also properly configured (tested by performing a successful migration) DNS is pointing properly to my directory, because I got a regular 404 error before there was any content in the target directory. I've set the APP_ENV to production and APP_DEBUG to false in my .env file. The target directory is indeed the /public directory within the app. I ran '''sudo chmod 755 -R .''' in the top-level app directory and on the nginx directories, again to no avail. This addresses every suggested fix to this error I've found so far, and I don't know what to try at this point.
First, you should change those public facing permissions to 644 and then elevate as necesssary for tasks that require it. Second Check the logs. This big question, did you use Forge or Envoyer? If not, make sure you configured nginx properly and then restart nginx. Are you sure the APP_KEY is in the .env file? Also, you should run php artisan config:clear after any changes to .env. A last stitch effort may be to redeploy.
The /storage/logs/laravel.log file contains only two error messages pertaining to my initial failed database migrations before I fixed my database config and got the migrations working properly. I did not use Forge or Envoyer, just a git commit using a post-receive hook. The Nginx config was showing a 404 previously when the directory was empty, which is the behavior I was expecting--and it shows the standard greeting page when you plug in just the IP instead of the domain. I have restarted nginx after every config change.
The APP_KEY is set, and I have run '''php artisan config:clear''', but this has also not worked.
I changed the user in my nginx config to the user who has ownership of the app, and now instead of the previous error, I'm getting a 502 bad gateway error.
Resolved the 502 bad gateway error. All references to fastcgi_pass in both the nginx sites-enabled config and php-fpm's www.conf (found in '''/etc/php/7.0/fpm/pool.d```) must be altered to point to 127.0.0.1:9000, and you must set the correct username for the 'user' and listen.owner properties in the same file provided you didn't go with the standard assumed www-data username.
The error is too generic and does not tell you exact problem. What you need is to find out what is the real issue. If your site is serving a Internal Server Error, this can be caused by a number of things, such as:
Errors in .htaccess files
Server permission
Server timeout
Script timeout
Or some other Web Server Issues
Normally, a permissions issue on the file (or files) would be one cause of the 500 Internal Server Error. The simple solution is to run chmod 644 on the problem file(s) or chmod 755 on the directories.
$ sudo chmod -R 777 /"your files location"
The best way to debug the error depends upon the server and what's actually running at the time. Consider some debugging tips to help diagnose and fix common causes of this problem.