Whoops \ Exception \ ErrorException (E_WARNING)
Whoops\Exception\ErrorException thrown with message "mysqli::mysqli(): (HY000/1040): Too many connections" Stacktrace: #12 Whoops\Exception\ErrorException in /var/www/html/src/PMCOM/Core/Database.php:111 #11 mysqli:mysqli in /var/www/html/src/PMCOM/Core/Database.php:111 #10 PMCOM\Core\Database:getSqlInstance in /var/www/html/src/PMCOM/Core/Database.php:55 #9 PMCOM\Core\Database:__construct in /var/www/html/src/PMCOM/Core/Database.php:66 #8 PMCOM\Core\Database:getInstance in /var/www/html/src/PMCOM/Core/Router.php:138 #7 PMCOM\Core\Router:_redirect_url in /var/www/html/src/PMCOM/Core/Router.php:163 #6 call_user_func_array in /var/www/html/src/PMCOM/Core/Router.php:163 #5 PMCOM\Core\Router:__callStatic in /var/www/html/src/PMCOM/Core/Router.php:55 #4 PMCOM\Core\Router:redirect_url in /var/www/html/src/PMCOM/Core/Router.php:55 #3 PMCOM\Core\Router:_get_route in /var/www/html/src/PMCOM/Core/Router.php:163 #2 call_user_func_array in /var/www/html/src/PMCOM/Core/Router.php:163 #1 PMCOM\Core\Router:__callStatic in /var/www/html/index.php:101 #0 PMCOM\Core\Router:get_route in /var/www/html/index.php:101

mysqli::mysqli(): (HY000/1040): Too many connections

Stack frames (13):
12 Whoops\Exception\ErrorException
…/­src/­PMCOM/­Core/­Database.php111
11 mysqli mysqli
…/­src/­PMCOM/­Core/­Database.php111
10 PMCOM\Core\Database getSqlInstance
…/­src/­PMCOM/­Core/­Database.php55
9 PMCOM\Core\Database __construct
…/­src/­PMCOM/­Core/­Database.php66
8 PMCOM\Core\Database getInstance
…/­src/­PMCOM/­Core/­Router.php138
7 PMCOM\Core\Router _redirect_url
…/­src/­PMCOM/­Core/­Router.php163
6 call_user_func_array
…/­src/­PMCOM/­Core/­Router.php163
5 PMCOM\Core\Router __callStatic
…/­src/­PMCOM/­Core/­Router.php55
4 PMCOM\Core\Router redirect_url
…/­src/­PMCOM/­Core/­Router.php55
3 PMCOM\Core\Router _get_route
…/­src/­PMCOM/­Core/­Router.php163
2 call_user_func_array
…/­src/­PMCOM/­Core/­Router.php163
1 PMCOM\Core\Router __callStatic
…/­index.php101
0 PMCOM\Core\Router get_route
…/­index.php101
/var/www/html/src/PMCOM/Core/Database.php
 
	/**
	 * [getSqlInstance description]
	 * @return [type] [description]
	 */
	public static function getSqlInstance()
	{
        if ( NULL === self::$instance )
		{
            self::$instance = new MySQLi( dbHost, dbUser, dbPass, dbName );
            self::$instance->set_charset("utf8");
            if ( mysqli_connect_error() )
			{
                die( 'Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error() );
            }
        }
        return self::$instance;
    }
 
    /**
/var/www/html/src/PMCOM/Core/Database.php
 
	/**
	 * [getSqlInstance description]
	 * @return [type] [description]
	 */
	public static function getSqlInstance()
	{
        if ( NULL === self::$instance )
		{
            self::$instance = new MySQLi( dbHost, dbUser, dbPass, dbName );
            self::$instance->set_charset("utf8");
            if ( mysqli_connect_error() )
			{
                die( 'Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error() );
            }
        }
        return self::$instance;
    }
 
    /**
cpt-obvious This frame is within function 'mysqli'
/var/www/html/src/PMCOM/Core/Database.php
	 * @var [type]
	 */
	private static $m_pInstance;
 
	/**
	 * [__construct description]
	 */
	public function __construct()
	{
		$this->link = self::getSqlInstance();
	}
 
	/**
	 * [getInstance description]
	 * @return [type] [description]
	 */
	public static function getInstance()
	{
	    if ( ! self::$m_pInstance )
	    {
cpt-obvious This frame is within function 'getSqlInstance'
/var/www/html/src/PMCOM/Core/Database.php
 
	/**
	 * [getInstance description]
	 * @return [type] [description]
	 */
	public static function getInstance()
	{
	    if ( ! self::$m_pInstance )
	    {
	        self::$m_pInstance = new Database();
	    }
	    return self::$m_pInstance;
	}
 
	/**
	 * [lists description]
	 * @param  [type]  $table      [description]
	 * @param  [type]  $whereArray [description]
	 * @param  [type]  $listValue  [description]
	 * @param  boolean $listKey    [description]
cpt-obvious This frame is within function '__construct'
/var/www/html/src/PMCOM/Core/Router.php
 
	/**
	 * [_redirect_url description]
	 * @param  [type] $url [description]
	 * @return [type]      [description]
	 */
 
	public function _redirect_url($url)
	{
		$database = Database::getInstance();
		$redirect = $database->get('url_redirects', array('old_url' => $url, 'site_id' => SITE));
		if( ! $redirect ) {
			$redirect = $database->get('url_redirects', array('old_url' => rtrim($url,'/'), 'site_id' => SITE));
		}
		if($redirect)
		{
			header("HTTP/1.1 301 Moved Permanently");
			redirect($redirect->new_url);
		}
	}
cpt-obvious This frame is within function 'getInstance'
/var/www/html/src/PMCOM/Core/Router.php
	 * @return [type]             [description]
	 */
 
	public static function __callStatic( $method, $parameters )
	{
		if( is_null( static::$instance ) )
		{
			static::$instance = new Router();
		}
		return call_user_func_array( array( static::$instance, '_' . $method ), $parameters );
	}
 
}
cpt-obvious This frame is within function '_redirect_url'
/var/www/html/src/PMCOM/Core/Router.php
	 * @return [type]             [description]
	 */
 
	public static function __callStatic( $method, $parameters )
	{
		if( is_null( static::$instance ) )
		{
			static::$instance = new Router();
		}
		return call_user_func_array( array( static::$instance, '_' . $method ), $parameters );
	}
 
}
cpt-obvious This frame is within function 'call_user_func_array'
/var/www/html/src/PMCOM/Core/Router.php
 
	/**
	 * [_get_route description]
	 * @return [type] [description]
	 */
 
	public function _get_route( $container )
	{
		$this->container = $container;
		self::redirect_url( $_SERVER['REQUEST_URI'] );
		$requestURI = explode( '?', $_SERVER['REQUEST_URI'] );
		$segments = array_filter( explode( '/', trim( $requestURI[0], '/' ) ) );
 
		if( count( $segments ) === 0 ) :
			// Home Page
			die( call_user_func_array( array( $this->container->get( 'PMCOM\\Front\\Page' ), 'index' ), array() ) );
		else :
			// Anything else..
			if( self::studly( $segments[0] ) === $this->adminPrefix ) :
				unset( $segments[0] );
cpt-obvious This frame is within function '__callStatic'
/var/www/html/src/PMCOM/Core/Router.php
 
	/**
	 * [_get_route description]
	 * @return [type] [description]
	 */
 
	public function _get_route( $container )
	{
		$this->container = $container;
		self::redirect_url( $_SERVER['REQUEST_URI'] );
		$requestURI = explode( '?', $_SERVER['REQUEST_URI'] );
		$segments = array_filter( explode( '/', trim( $requestURI[0], '/' ) ) );
 
		if( count( $segments ) === 0 ) :
			// Home Page
			die( call_user_func_array( array( $this->container->get( 'PMCOM\\Front\\Page' ), 'index' ), array() ) );
		else :
			// Anything else..
			if( self::studly( $segments[0] ) === $this->adminPrefix ) :
				unset( $segments[0] );
cpt-obvious This frame is within function 'redirect_url'
/var/www/html/src/PMCOM/Core/Router.php
	 * @return [type]             [description]
	 */
 
	public static function __callStatic( $method, $parameters )
	{
		if( is_null( static::$instance ) )
		{
			static::$instance = new Router();
		}
		return call_user_func_array( array( static::$instance, '_' . $method ), $parameters );
	}
 
}
cpt-obvious This frame is within function '_get_route'
/var/www/html/src/PMCOM/Core/Router.php
	 * @return [type]             [description]
	 */
 
	public static function __callStatic( $method, $parameters )
	{
		if( is_null( static::$instance ) )
		{
			static::$instance = new Router();
		}
		return call_user_func_array( array( static::$instance, '_' . $method ), $parameters );
	}
 
}
cpt-obvious This frame is within function 'call_user_func_array'
/var/www/html/index.php
/*
|---------------------------------------------------------------
| LOAD THE ROUTES CLASS
|---------------------------------------------------------------
|
| And away we go...
|
*/
 
PMCOM\Core\Router::get_route( $container );
cpt-obvious This frame is within function '__callStatic'
/var/www/html/index.php
/*
|---------------------------------------------------------------
| LOAD THE ROUTES CLASS
|---------------------------------------------------------------
|
| And away we go...
|
*/
 
PMCOM\Core\Router::get_route( $container );
cpt-obvious This frame is within function 'get_route'

Environment & details:

empty
empty
empty
empty
empty
Key Value
REDIRECT_SCRIPT_URL
"/craft-model-and-hobby/cake-decorating/cake-craft-1/stencils/cakecraft-3d-boxes-stencil/"
REDIRECT_SCRIPT_URI
"https://www.shesto.co.uk/craft-model-and-hobby/cake-decorating/cake-craft-1/stencils/cakecraft-3d-boxes-stencil/"
REDIRECT_HTTPS
"on"
REDIRECT_SSL_TLS_SNI
"www.shesto.co.uk"
REDIRECT_STATUS
"200"
SCRIPT_URL
"/craft-model-and-hobby/cake-decorating/cake-craft-1/stencils/cakecraft-3d-boxes-stencil/"
SCRIPT_URI
"https://www.shesto.co.uk/craft-model-and-hobby/cake-decorating/cake-craft-1/stencils/cakecraft-3d-boxes-stencil/"
HTTPS
"on"
SSL_TLS_SNI
"www.shesto.co.uk"
HTTP_USER_AGENT
"CCBot/2.0 (https://commoncrawl.org/faq/)"
HTTP_ACCEPT
"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
HTTP_ACCEPT_LANGUAGE
"en-US,en;q=0.5"
HTTP_IF_MODIFIED_SINCE
"Fri, 21 Feb 2020 22:18:03 EST"
HTTP_ACCEPT_ENCODING
"br,gzip"
HTTP_HOST
"www.shesto.co.uk"
HTTP_CONNECTION
"Keep-Alive"
PATH
"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
SERVER_SIGNATURE
"<address>Apache/2.4.29 (Ubuntu) Server at www.shesto.co.uk Port 443</address>\n"
SERVER_SOFTWARE
"Apache/2.4.29 (Ubuntu)"
SERVER_NAME
"www.shesto.co.uk"
SERVER_ADDR
"104.248.173.198"
SERVER_PORT
"443"
REMOTE_ADDR
"3.235.24.23"
DOCUMENT_ROOT
"/var/www/html/"
REQUEST_SCHEME
"https"
CONTEXT_PREFIX
""
CONTEXT_DOCUMENT_ROOT
"/var/www/html/"
SERVER_ADMIN
"[no address given]"
SCRIPT_FILENAME
"/var/www/html/index.php"
REMOTE_PORT
"49480"
REDIRECT_URL
"/craft-model-and-hobby/cake-decorating/cake-craft-1/stencils/cakecraft-3d-boxes-stencil/"
GATEWAY_INTERFACE
"CGI/1.1"
SERVER_PROTOCOL
"HTTP/1.1"
REQUEST_METHOD
"GET"
QUERY_STRING
""
REQUEST_URI
"/craft-model-and-hobby/cake-decorating/cake-craft-1/stencils/cakecraft-3d-boxes-stencil/"
SCRIPT_NAME
"/index.php"
PHP_SELF
"/index.php"
REQUEST_TIME_FLOAT
1585539793.231
REQUEST_TIME
1585539793
empty
0. PMCOM\Core\PurposeHandler
1. Whoops\Handler\CallbackHandler