在使用apache2,mysql和PHP的Mac OS X 10.12安装上通过本地主机运行PHP代码时,出现以下错误。
Warning: mysqli_connect(): (HY000/2002): Too many levels of symbolic links in /Users/kevin/Sites/quest/includes/db_connection.php on line 7 Database connection failed: Too many levels of symbolic links (2002)
我在usr / lib / php目录或usr / local / mysql目录中未找到任何递归符号链接。如何解决此错误?
<?php
define("DB_SERVER", "localhost");
define("DB_USER", "<my usr>");
define("DB_PASS", "<my pass>");
define("DB_NAME", "<my db>");
//creates a database connection
$connection = mysqli_connect(DB_SERVER, DB_USER, DB_PASS, DB_NAME);
// tests connection for errors
if(mysqli_connect_errno()) {
die("Database connection failed: ".
mysqli_connect_error() .
" (" . mysqli_connect_errno() . ")"
);
}
?>