A PHP Error was encountered

Severity: Warning

Message: mysqli::real_connect(): (HY000/2002): Cannot assign requested address

Filename: mysqli/mysqli_driver.php

Line Number: 201

Backtrace:

File: /www/wwwroot/dash.konsole.xyz/application/core/MY_Controller.php
Line: 343
Function: __construct

File: /www/wwwroot/dash.konsole.xyz/application/controllers/Api.php
Line: 12
Function: __construct

File: /www/wwwroot/dash.konsole.xyz/index.php
Line: 316
Function: require_once

Database Error

数据库发生错误。

无法使用提供的设置连接到数据库服务器。

Filename: core/MY_Controller.php

Line Number: 343


Fatal error: Uncaught Error: Call to a member function close() on string in /www/wwwroot/dash.konsole.xyz/application/core/MY_Controller.php:349 Stack trace: #0 [internal function]: Index_Controller->__destruct() #1 {main} thrown in /www/wwwroot/dash.konsole.xyz/application/core/MY_Controller.php on line 349
HEX
HEX
Server: Apache/2
System: Linux ns1.websitegang.club 5.4.0-149-generic #166-Ubuntu SMP Tue Apr 18 16:51:45 UTC 2023 x86_64
User: kunchorn (1109)
PHP: 8.2.29
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: /home/kunchorn/public_html/wp-content/plugins/testimonial-free/src/Admin/DBUpdates.php
<?php
/**
 * Fired during plugin updates.
 *
 * This class defines all code necessary to run during the plugin's updates.
 *
 * @since      2.1.5
 *
 * @package Testimonial_free.
 * @subpackage Testimonial_free/Admin
 * @author     ShapedPlugin <support@shapedplugin.com>
 */

namespace ShapedPlugin\TestimonialFree\Admin;

// don't call the file directly.
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * DBUpdates
 */
class DBUpdates {

	/**
	 * DB updates that need to be run
	 *
	 * @var array
	 */
	private static $updates = array(
		'2.1.5'  => 'updates/update-2.1.5.php',
		'2.2.5'  => 'updates/update-2.2.5.php',
		'2.2.10' => 'updates/update-2.2.10.php',
		'2.5.5'  => 'updates/update-2.5.5.php',
		'2.6.1'  => 'updates/update-2.6.1.php',
		'3.0.0'  => 'updates/update-3.0.0.php',
		'3.1.2'  => 'updates/update-3.1.2.php',
		'3.1.8'  => 'updates/update-3.1.8.php',
	);

	/**
	 * Binding all events
	 *
	 * @since 2.1.5
	 *
	 * @return void
	 */
	public function __construct() {
		add_action( 'plugins_loaded', array( $this, 'do_updates' ) );
	}

	/**
	 * Check if need any update
	 *
	 * @since 2.1.5
	 *
	 * @return boolean
	 */
	public function is_needs_update() {
		$installed_version = get_option( 'testimonial_version' );
		$first_version     = get_option( 'testimonial_first_version' );
		$activation_date   = get_option( 'testimonial_activation_date' );

		if ( false === $installed_version ) {
			update_option( 'testimonial_version', SP_TFREE_VERSION );
			update_option( 'testimonial_db_version', SP_TFREE_VERSION );
		}
		if ( false === $first_version ) {
			update_option( 'testimonial_first_version', SP_TFREE_VERSION );
		}
		if ( false === $activation_date ) {
			update_option( 'testimonial_activation_date', current_time( 'timestamp' ) );
		}

		if ( version_compare( $installed_version, SP_TFREE_VERSION, '<' ) ) {
			return true;
		}

		return false;
	}

	/**
	 * Do updates.
	 *
	 * @since 2.1.5
	 *
	 * @return void
	 */
	public function do_updates() {
		$this->perform_updates();
	}

	/**
	 * Perform all updates
	 *
	 * @since 2.1.5
	 *
	 * @return void
	 */
	public function perform_updates() {
		if ( ! $this->is_needs_update() ) {
			return;
		}

		$installed_version = get_option( 'testimonial_version' );

		foreach ( self::$updates as $version => $path ) {
			if ( version_compare( $installed_version, $version, '<' ) ) {
				include $path;
				update_option( 'testimonial_version', $version );
			}
		}

		update_option( 'testimonial_version', SP_TFREE_VERSION );
	}
}