Firemaps's avatar

Failed to load resource: the server responded with a status of 500 (HTTP/2.0 500)

On my site I am trying to upload images and extract information from the exif, including GPS tag etc.

On laptop, there is no problem. However on mobile, with the same images, I am getting "Failed to load resource: the server responded with a status of 500 (HTTP/2.0 500)"

How can I debug this? Or is there something else I can install?

This suggests https://www.digitalocean.com/community/questions/getting-500-internal-server-error $ apt-get install php5-curl

I have a feeling its a permissions issue...? Anyone?

0 likes
4 replies
lostdreamer_nl's avatar

on 500 errors, you should check you apache / nginx log to see what exactly is going wrong....

Never just install a package on your server (apt-get install) because some page tells you to unless you know exactly what it is you're doing.

1 like
Firemaps's avatar

Another one of my problems, probably related to this, is I have a permissions issue. I ran composer update in production and something got messed up somewhere.

This is the only way I have gotten things to work (until now)

drwxrwx--- 15 forge www-data 4096 Nov  2 11:42 mysite.com
forge@ip-172-31-22-175:~$ cd mysite.com/
forge@ip-172-31-22-175:~/mysite.com$ ls -l
total 440
drwxrwxr-x 10 forge www-data   4096 Nov  2 12:33 app
-rw-rw-r--  1 forge www-data   1646 Sep 10 11:19 artisan
drwxrwxr-x  3 forge www-data   4096 Nov  2 12:33 bootstrap
-rw-rw-r--  1 forge www-data   1910 Sep 10 11:19 composer.json
-rw-rw-r--  1 forge forge    208335 Sep 10 13:37 composer.lock
drwxrwx---  2 forge www-data   4096 Sep 10 11:19 config
drwxrwx---  5 forge www-data   4096 Sep 10 11:19 database
-rw-rw-r--  1 forge forge      2188 Nov  2 11:42 package.json
-rw-rw-r--  1 forge www-data   1055 Sep 10 11:19 phpunit.xml
drwxrwx---  7 forge www-data   4096 Sep 17 16:15 public
-rw-rw-r--  1 forge www-data   2906 Sep 10 11:19 readme.md
drwxrwx---  5 forge www-data   4096 Sep 10 11:19 resources
drwxrwx---  2 forge www-data   4096 Oct 16 17:30 routes
-rw-rw-r--  1 forge www-data      0 Sep 10 11:19 routes.js
drwxrwx---  5 forge www-data   4096 Sep 10 11:19 semantic
-rw-rw-r--  1 forge www-data   1158 Sep 10 11:19 semantic.json
-rw-rw-r--  1 forge www-data    563 Sep 10 11:19 server.php
-rw-rw-r--  1 forge www-data    753 Sep 10 11:19 socket.js
drwxrwxr-x  5 forge www-data   4096 Apr 11  2017 storage
drwxrwx---  4 forge www-data   4096 Sep 10 11:19 tests
drwxrwx--- 55 forge www-data   4096 Nov 28 12:50 vendor
-rw-rw-r--  1 forge forge      1281 Sep 15 10:13 webpack.mix.js
-rw-rw-r--  1 forge www-data 151956 Sep 10 11:19 yarn.lock
forge@ip-172-31-22-175:~/mysite.com$ 

I think I remember running $ chown -R forge:forge /path but it may have been reset back to this.

Please help!

cbj4074's avatar

Those permissions don't necessarily look problematic. You should be able to run composer commands in production (or any other environment), provided you run them as an appropriate user; that is, the user under whom PHP runs for the host in question (and not "root"!).

I wouldn't change the permissions until you have concrete evidence to suggest that they are problematic as is. If you are seeing "Access denied" or similar in a log, then please post the specific message.

I concur with @lostdreamer_nl in that you should see evidence of the 500 error in your web-server logs. You can tail the log while you hit the site with your iPhone and see what activity is logged for the IP address in question:

$ sudo tail -f -n 80 /var/log/nginx/error.log

(adjust the path to the log as necessary)

ejdelmonico's avatar

Quite frankly, you shouldn't have to do anything in particular to a forge server except add any special modules that your code needs. Forge servers already have what you need installed in 98% of the cases. You should never change permissions unless you know absolutely why they are incorrect. For instance, if you site directory has improper permissions then that tells me that you installed something with incorrect permissions like using root. So, now only the root user can manipulate the package, etc. Composer is already installed and updated with a forge server so permissions should be correct. If they are not, someone installed it again with different permissions. Remember permission inheritance is a problem when something is installed. The package will automatically assume the permissions of the installer in most cases.

Please or to participate in this conversation.