解决“致命错误:最大功能嵌套级别为'100',正在中止!"的解决方案.在PHP中 [英] Solution for "Fatal error: Maximum function nesting level of '100' reached, aborting!" in PHP

查看:147
本文介绍了解决“致命错误:最大功能嵌套级别为'100',正在中止!"的解决方案.在PHP中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我制作了一个函数,该函数可以找到html文件中的所有URL,并对链接到发现的URL的每个html内容重复相同的过程.该函数是递归的,可以无休止地进行下去.但是,我通过设置一个全局变量来限制递归,该全局变量将导致递归在100次递归后停止.

I have made a function that finds all the URLs within an html file and repeats the same process for each html content linked to the discovered URLs. The function is recursive and can go on endlessly. However, I have put a limit on the recursion by setting a global variable which causes the recursion to stop after 100 recursions.

但是,php返回此错误:

However, php returns this error:

致命错误:达到最大功能嵌套级别'100', 流产!在 D:\ wamp \ www \ crawler1 \ simplehtmldom_1_5 \ simple_html_dom.php在线 1355

Fatal error: Maximum function nesting level of '100' reached, aborting! in D:\wamp\www\crawler1\simplehtmldom_1_5\simple_html_dom.php on line 1355

我在这里找到了一个解决方案:增加嵌套函数的调用限制,但这不是就我而言.

I found a solution here: Increasing nesting function calls limit but this is not working in my case.

我引用了上面提到的链接中的答案之一.请考虑一下.

您是否已安装Zend,IonCube或xDebug?如果是,那可能就是您从中收到此错误的地方.

"Do you have Zend, IonCube, or xDebug installed? If so, that is probably where you are getting this error from.

几年前,我遇到了这个问题,最后是Zend将限制放在那里,而不是PHP.当然,删除它会让您超过100次迭代,但最终会达到内存限制."

I ran into this a few years ago, and it ended up being Zend putting that limit there, not PHP. Of course removing it will let >you go past the 100 iterations, but you will eventually hit the memory limits."

有没有一种方法可以提高PHP中最大的函数嵌套级别

Is there a way to increase the maximum function nesting level in PHP

推荐答案

一个简单的解决方案解决了我的问题.我刚刚评论了这一行:

A simple solution solved my problem. I just commented this line:

zend_extension = "d:/wamp/bin/php/php5.3.8/zend_ext/php_xdebug-2.1.2-5.3-vc9.dll

我的php.ini文件中的

.此扩展将堆栈限制为100,因此我将其禁用.递归功能现在正在按预期方式工作.

in my php.ini file. This extension was limiting the stack to 100 so I disabled it. The recursive function is now working as anticipated.

这篇关于解决“致命错误:最大功能嵌套级别为'100',正在中止!"的解决方案.在PHP中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆