Solution for "Fatal error: Maximum function nesting level of '100' reached, aborting!" in PHP

solution meaning
solution synonym
solution to or of an equation
solution preposition
solution for question
solution to doing
offer a solution
give solution

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.

However, php returns this error:

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.

I am quoting one of the answers from the link mentioned above. Please do consider it.

"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."

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

Increase the value of xdebug.max_nesting_level in your php.ini

Difference Between Solution to and Solution for, In English, we generally say solution to a problem. Going back to our definition of giving a present or a gift when using for, it doesn't make sense� I wonder what Jasper said—sounds like it was of use. To me, the difference between a solution to a problem and a solution for a problem is that the latter indicates a possible, suggested solution (yet to be verified as something that truly solves the problem), while the former is a more definitely efficient solution—if applicable, the only possible solution.

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

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.

SOLUTION, solution definition: 1. the answer to a problem: 2. a liquid into which a solid has been mixed and has dissolved: 3…. Learn more. The doctor found a solution for the patient. If you consider the thing to be a living organism like in some cases a company or a city you can use solution for. For example, The new accountant found a solution to the company’s financial problem. The city contracted new engineers to find a solution for the traffic problem in the city.

Rather than going for a recursive function calls, work with a queue model to flatten the structure.

$queue = array('http://example.com/first/url');
while (count($queue)) {
    $url = array_shift($queue);

    $queue = array_merge($queue, find_urls($url));
}

function find_urls($url)
{
    $urls = array();

    // Some logic filling the variable

    return $urls;
}

There are different ways to handle it. You can keep track of more information if you need some insight about the origin or paths traversed. There are also distributed queues that can work off a similar model.

Which is correct, 'solution for' or 'solution of'?, Ignoring the use of the word solution as a liquid combining substances I would say the normal answer to the question is neither of the proposals. If a problem can� Solution definition is - an action or process of solving a problem. How to use solution in a sentence.

Another solution is to add xdebug.max_nesting_level = 200 in your php.ini

Solution for/to a problem, For is most popular as it is instrumental and intended-possessive "The remedy for your problem is posting on WRF." The solution to is most� 2 synonyms of solution from the Merriam-Webster Thesaurus, plus 6 related words, definitions, and antonyms. Find another word for solution. Solution: something attained by mental effort and especially by computation.

Rather than disabling the xdebug, you can set the higher limit like

xdebug.max_nesting_level=500

Solution, Examples of solution in a Sentence. Medication may not be the best solution for the patient's condition. The solution is simple you need to spend less money. solution definition: 1. the answer to a problem: 2. a liquid into which a solid has been mixed and has dissolved: 3…. Learn more.

Abdullah �calan: My Solution for Turkey, Syria, and the Kurds, For over two decades, Kurdish leader Abdullah �calan has been held in the Turkish prison on İmralı Island. In this op-ed for Jacobin , he calls� Synonyms for solution at Thesaurus.com with free online thesaurus, antonyms, and definitions. Find descriptive alternatives for solution.

A global solution for the digital world, Therefore, their profits are not commensurate to their revenues in markets such as India. In trying to find a solution agreeable to all, multilateral� Solution, in chemistry, a homogenous mixture of two or more substances in relative amounts that can be varied continuously up to what is called the limit of solubility. The term solution is commonly applied to the liquid state of matter, but solutions of gases and solids are possible.

Tygacil 50mg powder for solution for infusion, The recommended dose for adults is an initial dose of 100 mg followed by 50 mg every 12 hours for 5 to 14 days. The duration of therapy should be guided by the � The concentration of a solution is the proportion of the solute to solvent. If there is a lot of solute in a solution, then it is "concentrated". If there is a low amount of solute, then the solution is said to be "diluted." Miscible and immiscible When two liquids can be mixed to form a solution they are called "miscible."

Comments
  • Also: PHP doesn't have a limit on nested function calls, it must be an extension you're using that causes this.
  • @Abel I am sure that my code has no errors. There is a static variable which increments its value by one on each recursive call. If that variable is less than 100, the recursive calls go on until the variable reaches 100. I mean to say that the variable reaching 100 is actually the base case. While the error arises before 100 recursions. And as you have mentioned that some extension my be causing this, I would like to mention that I am using functions from simple_html_dom.php. If you have any idea about simple_html_dom.php, please help me in this regard. Please refer to updated question.
  • That is an error by xdebug. From the screenshot it's visible you use xdebug. You can disable the setting here: xdebug.max_nesting_level or tell how large the nesting level is.
  • if use WAMP, note that disabling xdebug in php.ini does NOT always work; same applies to extending level of allowed nesting; a bug a guess; SOLUTION: go to php.ini and comment out php_xdebug-???.dll
  • Possible duplicate of Increasing nesting functions calls limit
  • @A.L You edit your php.ini file and you add or edit the line xdebug.max_nesting_level in the XDebug section.
  • However if this is a production environment, see the accepted answer, which is to disable xdebug in that environment.
  • This solves the symptom (for a while), but not the problem.
  • This solution worked for me when I was using UFront for Haxe on MAMP.
  • for unlimited: xdebug.max_nesting_level = -1
  • So, eventually it was the XDebug extension after all... Good to know. In two days you can accept your own answer as accepted answer, if you want (and have a look at your previous questions, most miss an accepted answer).