ERROR » Database connection error! Please check your connection settings! [Too many connections]

     /var/www/html/Internal/package-database/Connection.php
        

155.     public function __construct(array $config = [])
156.     {
157.         $this->defaultConfig = Config::default('ZN\Database\DatabaseDefaultConfiguration')
158.                                      ::get('Database', 'database');
159.         $this->config        = array_merge($this->defaultConfig, $config);
160.         $this->db            = $this->runDriver();
161.         $this->prefix        = $this->config['prefix'];
162.         Properties::$prefix  = $this->prefix;
163. 
164. 
        
$this->db->connect($this->config); 165.     } 166.  167.     /** 168.      * Magic Debug Info 169.      */ 170.     public function __debugInfo() 171.     { 172.         return ['return' => $this->stringQuery ?: 'This is a general object, please call the sub method!']; 173.     } 174. 
     /var/www/html/Internal/package-database/DB.php
        

1346.      */
1347.     public function query(string $query, array $secure = [])
1348.     {
1349.         $secure     = $this->secure ?: $secure; $this->secure     = [];    
1350.         $caching    = $this->caching;           $this->caching    = [];
1351.         $tableName  = $this->tableName;         $this->tableName  = '';
1352.         $jsonDecode = $this->jsonDecode;        $this->jsonDecode = [];
1353.         $paging     = $this->paging;            
1354. 
1355. 
        return (new 
self($this->config))->setQueryByDriver($query, $secure,  1356.         [ 1357.             'caching'    => $caching,  1358.             'tableName'  => $tableName, 1359.             'jsonDecode' => $jsonDecode, 1360.             'paging'     => $paging 1361.         ]); 1362.     } 1363.  1364.     /** 1365.      * Exec Basic Query
     /var/www/html/Internal/package-database/DB.php
        

800.         }
801. 
802.         if( $this->transaction === true )
803.         {
804.             $this->transactionQueries[] = $finalQuery;
805. 
806.             return $this;
807.         }
808. 
809. 
        return 
$this->$returnQuery($finalQuery, $this->secure); 810.     } 811.  812.     /** 813.      * Duplicate Check 814.      *  815.      * @param string ...$args 816.      *  817.      * @return DB 818.      */ 819.     public function duplicateCheck(...$args) : DB
     /var/www/html/External/Libraries/Travel.php
        

767.         $Duration  = $StartDate->diff($EndDate);
768. 
769.         return ($Duration->days ?? 0) + 1;
770.     }
771. 
772.     public static function TourPrice($TourID)
773.     {
774.         $TourPrice = DB::Select('DoubleRoom')
775.                        ->Where('TourID', $TourID)
776. 
                       ->
Get('dejavutravel.TourPrices') 777.                        ->Value() ?? '0'; 778.  779.         return $TourPrice; 780.     } 781.  782.     /** 783.      * Get tour photo with optional image resizing for optimal page speed 784.      *  785.      * @param int $TourID Tour ID from database 786.      * @param string|int|null $Size Optional size parameter for image resizing
     /var/www/html/Internal/package-database/MySQLi/DB.php
        

136.         // @codeCoverageIgnoreEnd
137.         else
138.         {
139.             $this->connect = new MySQLi($host, $user, $pass, $db, $port);
140.         }
141.         restore_error_handler();
142.         
143.         if( $this->connect->connect_errno )
144.         {
145. 
            throw new 
ConnectionErrorException(NULL, $this->connect->connect_error); // @codeCoverageIgnore 146.         } 147.  148.         mysqli_report(MYSQLI_REPORT_OFF); 149.  150.         if( ! empty($this->config['charset']  ) ) $this->query("SET NAMES '".$this->config['charset']."'");   151.         if( ! empty($this->config['charset']  ) ) $this->query('SET CHARACTER SET '.$this->config['charset']);   152.         if( ! empty($this->config['collation']) ) $this->query('SET COLLATION_CONNECTION = "'.$this->config['collation'].'"'); 153.     } 154.  155.     /**