recursion - PHP "Fatal error: Maximum function nesting level of ' 10 0' reached, aborting!"的解决方法

标签 recursion xdebug php

我创建了一个函数来查找 html 文件中的所有 URL,并对链接到发现的 URL 的每个 html 内容重复相同的过程。该函数是递归的,可以无限执行。但是,我通过设置一个全局变量来限制递归,这会导致递归在 100 次递归后停止。

但是,php 返回这个错误:

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

ERROR

我在这里找到了解决方案:Increasing nesting function calls limit但这对我来说不起作用。

我引用了上述链接中的一个答案。请务必考虑。

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

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 中的最大函数嵌套级别

最佳答案

增加xdebug.max_nesting_level的值在你的 php.ini

关于recursion - PHP "Fatal error: Maximum function nesting level of ' 10 0' reached, aborting!"的解决方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53262698/

相关文章:

即使调试停止,Eclipse 仍占用端口 9000

php - 使用 xdebug 调试时出现空白页

docker - 轮询成功,但 Xdebug 尝试从 docker 容器连接到 PhpStorm 时出现错误 : Operation now in progress (29).

php - 否定实例

php - 在 Laravel 中使用用户过滤器缓存数据(不仅如此)

PHP - 从 HTML 中提取文本、翻译并放回

javascript - 将参数传递给递归函数javaScript

c++ - 我如何记住这种递归关系?

java - 二叉搜索树类 - 删除、搜索、插入、删除和迭代器方法 - 迭代与递归

scala - 懒惰的 val vs. Scala 中递归流的 val