我一直在网站上和网站 error_log 中将此错误消息显示为标题:
[2017 年 11 月 18 日 23:06:13 America/New_York] PHP 警告:出于安全原因,posix_uname() 已在第 1450 行的 /home/reddirtr/public_html/holland_college_mw19/includes/GlobalFunctions.php 中禁用
如何更改 GlobalFunctions.php 中的代码以删除警告?
function wfHostname() {
static $host;
if ( is_null( $host ) ) {
# Hostname overriding
global $wgOverrideHostname;
if ( $wgOverrideHostname !== false ) {
# Set static and skip any detection
$host = $wgOverrideHostname;
return $host;
}
if ( function_exists( 'posix_uname' ) ) {
// This function not present on Windows
$uname = posix_uname();
} else {
$uname = false;
}
if ( is_array( $uname ) && isset( $uname['nodename'] ) ) {
$host = $uname['nodename'];
} elseif ( getenv( 'COMPUTERNAME' ) ) {
# Windows computer name
$host = getenv( 'COMPUTERNAME' );
} else {
# This may be a virtual server.
$host = $_SERVER['SERVER_NAME'];
}
}
return $host;
}