pcntl_fork and the MySQL connection is gone

前端 未结 5 1893
执笔经年
执笔经年 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:10

    This helped for me: http://www.electrictoolbox.com/mysql-connection-php-fork/

    Especially mysql_connect($server, $username, $password, true);

提交回复
热议问题