pcntl_fork and the MySQL connection is gone

前端 未结 5 1882
执笔经年
执笔经年 2020-12-10 11:39

I have a foreach loop that forks within it. After the process forks, it accesses the database. I get an error:

SQLSTATE[HY000]: General error: 2006 MySQL ser         


        
5条回答
  •  一整个雨季
    2020-12-10 12:06

    You need to close the MySQL connection on your parent process and then make a new connection for each child.

提交回复
热议问题