<tfoot id='4lMI2'></tfoot>
        <legend id='4lMI2'><style id='4lMI2'><dir id='4lMI2'><q id='4lMI2'></q></dir></style></legend>

      1. <small id='4lMI2'></small><noframes id='4lMI2'>

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

        PHP/Apache 在脚本上崩溃(分段错误(11)

        PHP/Apache crashing on script (Segmentation fault (11)(PHP/Apache 在脚本上崩溃(分段错误(11))
        <legend id='umbq9'><style id='umbq9'><dir id='umbq9'><q id='umbq9'></q></dir></style></legend>

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

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

          1. <tfoot id='umbq9'></tfoot>
                <tbody id='umbq9'></tbody>

                <bdo id='umbq9'></bdo><ul id='umbq9'></ul>
                  本文介绍了PHP/Apache 在脚本上崩溃(分段错误(11)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  [已解决]

                  我正在 localhost 上运行一个 PHP 脚本(包含一些包含),该脚本在结束前一直崩溃.

                  I'm running a PHP script (with some includes) on localhost that keeps crashing before the end.

                  错误报告已开启.Opera、Safari 和 Firefox 返回一个空屏幕.但是 Chrome 会返回:

                  Error reporting is on. Opera, Safari and Firefox return an empty screen. But Chrome returns:

                  无法加载网页,因为服务器未发送任何数据.错误代码:ERR_EMPTY_RESPONSE

                  Unable to load the webpage because the server sent no data. Error code: ERR_EMPTY_RESPONSE

                  Apache 日志返回:

                  Apache logs returns:

                  [Sun Dec 15 19:29:23 2013] [notice] child pid 34267 exit signal分段错误(11)

                  [Sun Dec 15 19:29:23 2013] [notice] child pid 34267 exit signal Segmentation fault (11)

                  我第一次遇到问题时使用的是 PHP 5.5.6降级到 PHP 5.4.21 后问题依然存在.

                  Was using PHP 5.5.6 when I encountered the problem for the first time After downgrading to PHP 5.4.21 the problem still exists.

                  问题不在脚本内部.随机注释掉几行 50 行代码可以解决问题.让我想知道我的脚本是否可能需要执行很久.

                  The problem is not inside the script. Randomly commenting out a couple of 50 lines of code solves the problem. Making me wonder if my script might be to long for execution.

                  有人对我如何解决这个问题有任何建议吗?

                  Does anyone has any suggestions on how I can resolve this problem?

                  更新:

                  问题不仅出现在本地主机上,而且出现在我在 CentOs 6.4 和 PHP 5.3.3 上运行的网络服务器上,在 Apache 上也出现了同样的错误.

                  Problem doesn't only appears on the localhost but also on my webserver running on CentOs 6.4 and PHP 5.3.3 giving the same error on Apache.

                  [Sun Dec 15 23:15:10 2013] [notice] child pid 18409 exit signal分段错误(11)

                  [Sun Dec 15 23:15:10 2013] [notice] child pid 18409 exit signal Segmentation fault (11)

                  更新 2:

                  从命令行运行 php 给出:

                  Running php from the command line gives:

                  $ php index.php 致命错误:调用未定义函数第 135 行 Encrypt.class.php 中的 mcrypt_create_iv()

                  $ php index.php Fatal error: Call to undefined function mcrypt_create_iv() in Encrypt.class.php on line 135

                  在 Encrypt.class.php 的第 135 行之前放置注释后

                  After placing a comment before line 135 on Encrypt.class.php

                  $ php index.php
                  分段错误:11

                  $ php index.php
                  Segmentation fault: 11

                  UPDATE3:(解决方案)

                  使用 strace (strace php index.php) 在命令行上运行索引后,我在其中一个查询中发现了问题.

                  After running the index on command line with strace (strace php index.php) I found the problem at one of the queries.

                  经过更多调试(使用 PDO 而不是我自己的类)后,我发现问题在于设置我自己的 PDO 选项ATTR_PERSISTENT => true".禁用此选项解决了我的问题.

                  After some more debugging (using PDO instead of my own class) I found out that the problem was setting my own PDO option "ATTR_PERSISTENT => true". Disabling this option solved my problem.

                  推荐答案

                  UPDATE3:(解决方案)

                  UPDATE3: (Solution)

                  PDO 的持久化选项很可悲地破坏了我的表现.

                  Persisten option of PDO broke my performance sadly enough.

                  使用 strace 找到解决方案:使用 strace (strace php index.php) 在命令行上运行索引后,我在其中一个查询中发现了问题.

                  Found the solution with strace: After running the index on command line with strace (strace php index.php) I found the problem at one of the queries.

                  分离查询后,我用默认的 PDO 替换了我的类.添加我的班级的选项,直到它再次被打破:经过更多调试(使用 PDO 而不是我自己的类)后,我发现问题在于设置我自己的 PDO 选项ATTR_PERSISTENT => true".禁用此选项解决了我的问题.

                  After separating the query i replaced my class with default PDO. Adding options of my class till it was broken again: After some more debugging (using PDO instead of my own class) I found out that the problem was setting my own PDO option "ATTR_PERSISTENT => true". Disabling this option solved my problem.

                  这篇关于PHP/Apache 在脚本上崩溃(分段错误(11)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Converting string to MySQL timestamp format in php(在php中将字符串转换为MySQL时间戳格式)
                  datetime to timestamp(日期时间到时间戳)
                  PHP timestamp date to user timezone(PHP时间戳日期到用户时区)
                  Converting TIMESTAMP to unix time in PHP?(在 PHP 中将 TIMESTAMP 转换为 unix 时间?)
                  Convert ISO 8601 to unixtimestamp(将 ISO 8601 转换为 unixtimestamp)
                  Finding days between 2 unix timestamps in php(在php中查找2个unix时间戳之间的天数)

                        <tbody id='FBPTN'></tbody>

                      <legend id='FBPTN'><style id='FBPTN'><dir id='FBPTN'><q id='FBPTN'></q></dir></style></legend>

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

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