我创建了一个函数来查找 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
我在这里找到了解决方案: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/