My post was not exactly for this kind of error, that was only an example. My Question is generally, why there are differences between the localhost and a remote server. I didn’t change anything like “switching to production mode” or something else. But the Question still exists for this example, why don’t I get an error for this “static”-thing on localhost? (Ok the missing static declaration is wrong, but I expect an error on localhost as well!).
That it might be the error reporting is only a suggestion from you, right? So, I’m not sure if the error reporting causes a “500”-crash and on localhost it does not. Google didn’t helped me with that.
It is not likely that your both environments are the same, i really doubt this .
I am sure there are differences.
For php, just be sure you run same version on both environments, then copy the php.ini file from your live server to the development one.
This should take you to the closest step between servers, BUT keep in mind that it is important the way the PHP was compiled when installed. If on localhost you run xampp/wamp therefore, windows and on the production server you run linux, then i am sure it is a huge difference in the way the php was compiled .
Btw, the 500 error is not a PHP error, it is something that apache produces, most likely because of the mod rewrite .