Reputation: 8530
Some of my users that use Google Chrome or Firefox experience an Internal Server Error, once they clear their cache for my website, the error disappears. I had this issue over a year ago but switching to a different hoster "fixed" it, but now the issue has come back.
Here is what recently was done (not sure if any one, all or none of these caused it):
Of course I can tell my users to clear their cache, but I would also like to understand what might cause this or what potential could cause this behaviour (it's really hard to debug as only some users are affected).
Upvotes: 4
Views: 241
Reputation: 1340
Seems to be an error with PHP sessions:
It is fixed when users clear their cookies and may be occurs when the PHP version is updated.
Some session errors only occurs after determinated time and could be more randomly.
It could occurs in any point of your code (this can do the debug more dificult!).
Fixed when you change the hosting.(New server implies new or default session config)
Revise your PHP session configuration and your CakePHP session config (may be add it to the question could helps). ¿Are you using Memcached or similar?
Upvotes: 1
Reputation: 505
1 - Check your logs. If there aren't any error logs then enable logging on your servers. Check out https://book.cakephp.org/3.0/en/core-libraries/logging.html to use CakePHP logging, or check documentation for your server to enable logging on your server.
2 - You can try to use a try/catch block to echo the error out to the user, who can then give you a more specific error message. Go into the main PHP file and wrap all the contents in
try {
...... (your PHP code here) ......
} catch(Exception $e) {
die($e->getMessage());
}
If the error is related to an Exception that PHP can catch, the error message will be echoed out to the user. If you don't want to echo it out to the user (there may be some security concerns) then you can write $e->getMessage()
to a log file so that only you can see it.
Upvotes: 3