16

Fatal error: Maximum function nesting level of '100' reached, aborting! in ...\project\db.php on line 2

My db.php code

$db = mysql_connect ("localhost","db_user","password");
mysql_select_db("db_name",$db);

What's wrong?

1

3 Answers 3

39

Increase the value of xdebug.max_nesting_level in your php.ini, INFO
There is a question here

Sign up to request clarification or add additional context in comments.

3 Comments

thanks, this worked fine for me. I just used it at the script level for more security like: ini_set('xdebug.max_nesting_level', 200);
This is not a valid solution, You need to check the code whether the code is wasting request with the db or with other resources. Your code is somehow misusing the resources.
I changed mine to 4096, still get that error.. Clearly it must be a bug in the code?
11

Go into your php.ini configuration file and change the following line:

xdebug.max_nesting_level=100

to something like:

xdebug.max_nesting_level=200

2 Comments

Fatal error: Maximum function nesting level of '200' reached, aborting! in Z:\home\localhost\www\clientcms\db.php on line 2
I'm also getting Fatal error: Maximum function nesting level of '2000' reached, aborting! I set xdebug.max_nesting_level=2000
1

mysql_connect will return a boolean therefor :

<?php
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$link) {
    die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_select_db("databaseName");
?>

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.