PHP 错误:达到“100”的最大函数嵌套级别,正在中止

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17488505/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 12:58:57  来源:igfitidea点击:

PHP Error: Maximum function nesting level of '100' reached, aborting

mysqlphp

提问by oboshto

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

致命错误:达到“100”的最大函数嵌套级别,正在中止!在 ...\project\db.php 第 2 行

My db.php code

我的 db.php 代码

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

What's wrong?

怎么了?

回答by mirkobrankovic

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

增加值xdebug.max_nesting_level在php.ini,INFO
有一个问题在这里

回答by Wayne Whitty

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

进入您的 php.ini 配置文件并更改以下行:

xdebug.max_nesting_level=100

to something like:

类似于:

xdebug.max_nesting_level=200

回答by DarkBee

mysql_connect will return a boolean therefor :

mysql_connect 将为此返回一个布尔值:

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