I am trying to install mediawiki on a lites speed web server. It goes along well then I get the error:
Warning: Invalid argument supplied for foreach() in /usr/local/lsws/wiki/htdocs/w/includes/ProxyTools.php on line 17
Line 17 of ProxyTools.php is the one that starts with the foreach, I'm wondering if the apache_request_headers is causing the issue
function wfGetForwardedFor() {
if( function_exists( 'apache_request_headers' ) ) {
// More reliable than $_SERVER due to case and -/_ folding
$set = array ();
foreach ( apache_request_headers() as $tempName => $tempValue ) {
$set[ strtoupper( $tempName ) ] = $tempValue;
}
$index = strtoupper ( 'X-Forwarded-For' );
$index2 = strtoupper ( 'Client-ip' );
} else {
// Subject to spoofing with headers like X_Forwarded_For
$set = $_SERVER;
$index = 'HTTP_X_FORWARDED_FOR';
$index2 = 'CLIENT-IP';
Warning: Invalid argument supplied for foreach() in /usr/local/lsws/wiki/htdocs/w/includes/ProxyTools.php on line 17
Line 17 of ProxyTools.php is the one that starts with the foreach, I'm wondering if the apache_request_headers is causing the issue
function wfGetForwardedFor() {
if( function_exists( 'apache_request_headers' ) ) {
// More reliable than $_SERVER due to case and -/_ folding
$set = array ();
foreach ( apache_request_headers() as $tempName => $tempValue ) {
$set[ strtoupper( $tempName ) ] = $tempValue;
}
$index = strtoupper ( 'X-Forwarded-For' );
$index2 = strtoupper ( 'Client-ip' );
} else {
// Subject to spoofing with headers like X_Forwarded_For
$set = $_SERVER;
$index = 'HTTP_X_FORWARDED_FOR';
$index2 = 'CLIENT-IP';