Y
Y
Yuri Petrashevich2015-09-19 05:27:07
PHP
Yuri Petrashevich, 2015-09-19 05:27:07

UDP server in php. Error when using MySQL, how to fix?

server udp code - https://gist.github.com/belcoder/594ef4e1a796e1372d20
lines 40-60 I determine which message has arrived and run the desired function.
the functions themselves - https://gist.github.com/belcoder/c9c278175cd5987ff6c7
an error occurs:
dl1.joxi.net/drive/0006/2309/395525/150919/6326931...
52a8OnkfjjWMm0?d=1
it does not always appear, that is, there is no pattern Have not found.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2015-09-19
@BelCoder

that is, no, I did not find patterns.

This usually happens when you connect to the database and send the first request only after some time, say a minute.
solution - Doctrine/Connection has a ping method that checks if the connection to the database is alive.

P
profesor08, 2015-09-19
@profesor08

1. Since the exception does not always pop up, then look at the MySQL logs.
2. You are told what the matter is and even the error code is indicated: General error: 2006 MySQL server has gone away.
3. The most difficult thing remains - to overcome laziness.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question