CodePudding user response:
Reference:Do not connect the database before pcntl_fork, otherwise will be submitted to the MySQL server has gone away error,
Reason is that the child will inherit the main process of the database connection, when mysql data returned, the child can read data through this connection,
Cause data disorder,
https://bbs.csdn.net/topics/391872061