Topic on Project:Support desk

PHP Warning: posix_uname() has been disabled for security reasons in /includes/GlobalFunctions.php on line 1496

6
2A04:2413:8300:8480:4C8A:204B:9AD4:1FFF (talkcontribs)

PHP Warning: posix_uname() has been disabled for security reasons in /includes/GlobalFunctions.php on line 1496

Is the following fix safe/ok?

/includes/GlobalFunctions.php

put

if ( function_exists( 'posix_uname' ) ) {

// This function not present on Windows

$uname = /*posix_uname()*/ false;

} else {

instead of

if ( function_exists( 'posix_uname' ) ) {

// This function not present on Windows

$uname = posix_uname();

} else {

星耀晨曦 (talkcontribs)

Make sure you do not turn on safe mode or disable this function in php.ini.

Ciencia Al Poder (talkcontribs)

If a safe function like posix_uname is disabled on your installation, I imagine others will be as well. You probably won't be able to run MediaWiki on that host.

2A04:2413:8300:8480:B585:F64D:2BEF:8506 (talkcontribs)

@ Ciencia Al Poder Media wiki 1.30 works just fine. That function is blocked on my shared host.

2A04:2413:8300:8480:B585:F64D:2BEF:8506 (talkcontribs)

@星耀晨曦 I'm on a shared host and this function is disabled. Is my modification ok or not? Until now I don't see any errors or warnings in the logs.

Ciencia Al Poder (talkcontribs)

Your modification seems ok, although this is very weird

Reply to "PHP Warning: posix_uname() has been disabled for security reasons in /includes/GlobalFunctions.php on line 1496"