Media wiki install problem

alex

Well-Known Member
#1
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';
 

mistwang

LiteSpeed Staff
#2
can you write a small test PHP script to verify this.
apache_request_headers() is a function alias of litespeed_request_headers(). it should work.
 

alex

Well-Known Member
#3
George,
My php programmer suggested:

<?php
foreach (apache_request_headers() as $key => $value)
{
echo Name: $key / Value: $value<br />
}
exit;

and

<?php
foreach (litespeed_request_headers() as $key => $value)
{
echo Name: '$key' / Value: '$value'<br />
}
exit;

are both returning blank pages, view source also shows a blank page
 
Top