In https://github.com/piwik/piwik/blob/master/core/testMinimumPhpVersion.php#L93 code 500 is assumed if no other headers are present.
However, when comparing Apache2 + php5 mod vs nginx + php-fpm it turns out that invalid request throws 200 code on apache and 500 on nginx. This causes difficulties while trying to find actual issue on server running nginx with custom 4xx and 5xx pages.
Ugly fix: before throwing exception set code 200 headers ?
However I'm not sure if even this default 500 is required actually.
Any thougts ?
On Apache+Php5 I'm seeing the proper error 500 being set:
For this URL : index.php?module=CoreHome&action=index&idSite=X
How can I reproduce your issue?
If you can reproduce 500 error code on apache, then the next step would be to set custom 5xx error page. Problem lies in situation where end-user is being displayed custom and non-relevant message about 500 error, while it was actually Piwik exception which has it's verbose explaination (for example when user logs in but doesn't have any view/admin permissions. he normally would be displayed with instructions on what to do, but 5xx error page is served).
I've thought about this issue and perhaps custom error pages served and styled by Piwik would be some kind of solution to display relevant messages so users don't get confused ?