WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Самая быстрая Тема-конструктор для WordPress
функция не описана

wp_check_php_mysql_versions() WP 3.0.0

Check for the required PHP version, and the MySQL extension or a database drop-in.

Dies if requirements are not met.

Хуков нет.

Возвращает

Null. Ничего.

Использование

wp_check_php_mysql_versions();

Заметки

  • Global. Строка. $required_php_version The required PHP version string.
  • Global. Строка. $wp_version The WordPress version string.

Список изменений

С версии 3.0.0 Введена.

Код wp_check_php_mysql_versions() WP 5.5.1

<?php
function wp_check_php_mysql_versions() {
	global $required_php_version, $wp_version;
	$php_version = phpversion();

	if ( version_compare( $required_php_version, $php_version, '>' ) ) {
		$protocol = wp_get_server_protocol();
		header( sprintf( '%s 500 Internal Server Error', $protocol ), true, 500 );
		header( 'Content-Type: text/html; charset=utf-8' );
		printf( 'Your server is running PHP version %1$s but WordPress %2$s requires at least %3$s.', $php_version, $wp_version, $required_php_version );
		exit( 1 );
	}

	if ( ! extension_loaded( 'mysql' ) && ! extension_loaded( 'mysqli' ) && ! extension_loaded( 'mysqlnd' ) && ! file_exists( WP_CONTENT_DIR . '/db.php' ) ) {
		require_once ABSPATH . WPINC . '/functions.php';
		wp_load_translations_early();
		$args = array(
			'exit' => false,
			'code' => 'mysql_not_found',
		);
		wp_die(
			__( 'Your PHP installation appears to be missing the MySQL extension which is required by WordPress.' ),
			__( 'Requirements Not Met' ),
			$args
		);
		exit( 1 );
	}
}