<legend id='jxnJr'><style id='jxnJr'><dir id='jxnJr'><q id='jxnJr'></q></dir></style></legend>
  • <i id='jxnJr'><tr id='jxnJr'><dt id='jxnJr'><q id='jxnJr'><span id='jxnJr'><b id='jxnJr'><form id='jxnJr'><ins id='jxnJr'></ins><ul id='jxnJr'></ul><sub id='jxnJr'></sub></form><legend id='jxnJr'></legend><bdo id='jxnJr'><pre id='jxnJr'><center id='jxnJr'></center></pre></bdo></b><th id='jxnJr'></th></span></q></dt></tr></i><div id='jxnJr'><tfoot id='jxnJr'></tfoot><dl id='jxnJr'><fieldset id='jxnJr'></fieldset></dl></div>
      • <bdo id='jxnJr'></bdo><ul id='jxnJr'></ul>

      <small id='jxnJr'></small><noframes id='jxnJr'>

        <tfoot id='jxnJr'></tfoot>

        pcntl_fork 和 MySQL 连接消失了

        时间:2023-05-31

          • <bdo id='eIXjQ'></bdo><ul id='eIXjQ'></ul>
          • <small id='eIXjQ'></small><noframes id='eIXjQ'>

              <tbody id='eIXjQ'></tbody>

              1. <tfoot id='eIXjQ'></tfoot><legend id='eIXjQ'><style id='eIXjQ'><dir id='eIXjQ'><q id='eIXjQ'></q></dir></style></legend>

                  <i id='eIXjQ'><tr id='eIXjQ'><dt id='eIXjQ'><q id='eIXjQ'><span id='eIXjQ'><b id='eIXjQ'><form id='eIXjQ'><ins id='eIXjQ'></ins><ul id='eIXjQ'></ul><sub id='eIXjQ'></sub></form><legend id='eIXjQ'></legend><bdo id='eIXjQ'><pre id='eIXjQ'><center id='eIXjQ'></center></pre></bdo></b><th id='eIXjQ'></th></span></q></dt></tr></i><div id='eIXjQ'><tfoot id='eIXjQ'></tfoot><dl id='eIXjQ'><fieldset id='eIXjQ'></fieldset></dl></div>
                • 本文介绍了pcntl_fork 和 MySQL 连接消失了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个 foreach 循环,它在其中分叉.在进程 fork 之后,它访问数据库.我收到一个错误:

                  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 server has gone away
                  

                  问题是,我正在分叉之后连接到数据库.

                  The thing is, I'm connecting to the database after I've forked.

                  我的问题:为什么会发生这种情况?

                  My question: Why would this be happening?

                  如果发生这种情况,我是否真的在分叉之前访问了数据库??孩子会继承数据库连接吗?

                  If this happens, am I actually accessing the database before forking? Will the child inherit DB connections?

                  (注意:我可以发布代码,但它相当大,因为它都在类中,这可能是导致我在访问数据库时感到困惑的原因.您应该知道的另一件事是我正在使用 ZF.)

                  (note: I can post code, but it's rather large as it's all in classes, which could be what is causing my confusion of when I'm accessing the DB. Another thing you should know is I'm using ZF.)

                  推荐答案

                  (comment --> answer per poster's request)

                  (comment --> answer per poster's request)

                  阅读更多内容我看到分叉的孩子确实继承了他们父母的数据库连接,这是一个已知问题:http://php.net/manual/en/function.pcntl-fork.php#70721

                  Reading more into it I see forked children do inherit their parent's db connection, and it is a known problem: http://php.net/manual/en/function.pcntl-fork.php#70721

                  这篇关于pcntl_fork 和 MySQL 连接消失了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:在 Zend Framework 2.0 的控制器中更改布局 下一篇:Zend_Db_Table 子查询

                  相关文章

                  • <bdo id='VRefN'></bdo><ul id='VRefN'></ul>

                      <tfoot id='VRefN'></tfoot>

                      <small id='VRefN'></small><noframes id='VRefN'>

                    1. <i id='VRefN'><tr id='VRefN'><dt id='VRefN'><q id='VRefN'><span id='VRefN'><b id='VRefN'><form id='VRefN'><ins id='VRefN'></ins><ul id='VRefN'></ul><sub id='VRefN'></sub></form><legend id='VRefN'></legend><bdo id='VRefN'><pre id='VRefN'><center id='VRefN'></center></pre></bdo></b><th id='VRefN'></th></span></q></dt></tr></i><div id='VRefN'><tfoot id='VRefN'></tfoot><dl id='VRefN'><fieldset id='VRefN'></fieldset></dl></div>
                      <legend id='VRefN'><style id='VRefN'><dir id='VRefN'><q id='VRefN'></q></dir></style></legend>