检查您当地的主机

时间:2013-08-07 12:40:45

标签: php xampp

我已经在我的Windows 8上安装了xampp,从system32 / drivers到httd conf和vhost文件都做了所有必要的功能但是当我在浏览器上调用我的网站时我得到了这个错误请帮助

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000] 
[1203] User username already has more than 'max_user_connections' active connections' 
    in /home/username/public_html/library/Zend/Db/Adapter/Pdo/Abstract.php:129 
Stack trace: 
#0 /home/username/public_html/library/Zend/Db/Adapter/Pdo/Abstract.php(129): 
    PDO->__construct('mysql:host=mysq...', 'username', 'password', Array) 
#1 /home/username/public_html/library/Zend/Db/Adapter/Pdo/Mysql.php(96): 
    Zend_Db_Adapter_Pdo_Abstract->_connect() 
#2 /home/username/public_html/library/Zend/Db/Adapter/Abstract.php(448): 
    Zend_Db_Adapter_Pdo_Mysql->_connect() 
#3 /home/username/public_html/library/Zend/Db/Adapter/Pdo/Abstract.php(238): 
    Zend_Db_Adapter_Abstract->query('SHOW TABLES', Array) 
#4 /home/username/public_html/library/Zend/Db/Adapter/Abstract.php(765): 
    Zend_Db_Adapter_Pdo_Abstract->query('SHOW TABLES', Array) 
#5 /home/username/public_html/library/Zend/Db/Adapter/Pdo/Mysql.php(114): 
    Zend_Db_Adapter_Abstract->fetchCol('SHOW TABLES') 
#6 /home/username/pu in /home/username/public_html/library/Zend/Db/Adapter/Pdo/Abstract.php on line 144

1 个答案:

答案 0 :(得分:0)

这是PDO错误,PDO用于处理与数据库的连接。在这里,您可能与数据库打开了太多连接(每次访问数据库时,您可能会创建一个实例)。您必须关闭数据库或将单例模式与类连接一起使用

看看这里:

http://weebtutorials.com/2012/03/pdo-connection-class-using-singleton-pattern/

相关问题