CakePHP internal server Error only for some users who have passed after clearing the cache

Some of my users using Google Chrome or Firefox encounter an internal server error, as soon as they clear their cache for my site, the error disappears. I had this problem more than a year ago, but switching to another host "fixed" it, but now the problem has returned.

Here's what has been done recently (not sure if anyone, all or none of this caused it):

  • Upgraded CakePHP (from 2.8.9 to 2.10.7)
  • Changed PHP Config from php5.6 by default + CLI and php7.0, designed for the web role for php 7.0 for everyone (this was necessary to prevent collision of fpm process sockets and server crash on reboot)

Of course, I can tell my users to clear their cache, but I would also like to understand what can cause this or what potential this behavior can cause (it is really difficult to debug, since only some users are affected).

+4
source share
2 answers

1 - Check your magazines. If there are no error logs, enable logging on your servers. Check https://book.cakephp.org/3.0/en/core-libraries/logging.html to use CakePHP logging, or check the documentation for your server to enable logging on your server.

2. try/catch, , . PHP

try { 
  ...... (your PHP code here) ......
} catch(Exception $e) {
   die($e->getMessage());
}

, PHP, . ( ), $e->getMessage() , .

+3

, PHP:

  • , cookie PHP.
  • .
  • ( debug dificult!).
  • . ( )

    PHP, CakePHP ( , , ). ¿ Memcached ?

+1

Source: https://habr.com/ru/post/1693828/


All Articles