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?

oboshto
  • 3,280
  • 4
  • 23
  • 24
  • 1
    this error seems to be caused by x-debug, there is an answer for this in here http://stackoverflow.com/questions/4293775/increasing-nesting-functions-calls-limit – DevZer0 Jul 05 '13 at 12:07

3 Answers3

39

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

Community
  • 1
  • 1
mirkobrankovic
  • 2,309
  • 1
  • 19
  • 24
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
Wayne Whitty
  • 19,088
  • 5
  • 43
  • 65
  • Fatal error: Maximum function nesting level of '200' reached, aborting! in Z:\home\localhost\www\clientcms\db.php on line 2 – oboshto Jul 05 '13 at 12:20
  • 2
    I'm also getting Fatal error: Maximum function nesting level of '2000' reached, aborting! I set `xdebug.max_nesting_level=2000` – Joe Ejes Jan 17 '14 at 04:14
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");
?>
DarkBee
  • 15,492
  • 5
  • 46
  • 56