Search

User login

Poll

What is your favorite DB Server ?:
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
1 + 1 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.

My YM

Author Information

sentono
Offline
Last seen: 2 days 14 hours ago
Joined: 09/21/2007

Alexa Rank

Who's online

There are currently 0 users and 14 guests online.
Home
  • warning: Invalid argument supplied for foreach() in /usr/home/wowtutorial/public_html/sites/all/modules/adsense_injector/adsense_injector.module on line 352.
  • warning: Invalid argument supplied for foreach() in /usr/home/wowtutorial/public_html/sites/all/modules/adsense_injector/adsense_injector.module on line 35.

How To Fixed Invalid Argument Error When Installing MediaWiki

I just tried to install fresh MediaWiki and found this error when i finished installing MediaWiki.

Here is the error when we hit http://yourwiki.com
You can see the error for the first line in your wiki

[code]Warning: Invalid argument supplied for foreach() in /usr/home/wowwiki/public_html/includes/Setup.php on line 154[/code]

To Fixed/Removed this line, we can just simple edit the setup.php script on the line 154

First, login into your wiki server
edit the setup.php with your favorite editor such as nano,vi, etc.

[code]$vi /usr/home/wowwiki/public_html/includes/Setup.php[/code]

[code]### Find line 154 like below

Useful debug output
if ( $wgCommandLineMode ) {
wfDebug( "\n\nStart command line script $self\n" );
} elseif ( function_exists( 'getallheaders' ) ) {
wfDebug( "\n\nStart request\n" );
wfDebug( $_SERVER['REQUEST_METHOD'] . ' ' . $_SERVER['REQUEST_URI'] . "$
$headers = getallheaders();
foreach ($headers as $name => $value) {
wfDebug( "$name: $value\n" );
}
wfDebug( "\n" );
} elseif( isset( $_SERVER['REQUEST_URI'] ) ) {
wfDebug( $_SERVER['REQUEST_METHOD'] . ' ' . $_SERVER['REQUEST_URI'] . "$
}[/code]

Added comment (#) to the whole script like below

[code]# Useful debug output
# if ( $wgCommandLineMode ) {
# wfDebug( "\n\nStart command line script $self\n" );
# } elseif ( function_exists( 'getallheaders' ) ) {
# wfDebug( "\n\nStart request\n" );
# wfDebug( $_SERVER['REQUEST_METHOD'] . ' ' . $_SERVER['REQUEST_URI'] . "$
# $headers = getallheaders();
# foreach ($headers as $name => $value) {
# wfDebug( "$name: $value\n" );
# }
# wfDebug( "\n" );
# } elseif( isset( $_SERVER['REQUEST_URI'] ) ) {
# wfDebug( $_SERVER['REQUEST_METHOD'] . ' ' . $_SERVER['REQUEST_URI'] . "$
# }[/code]

Save and exit this file.
Try to hit your wiki from firefox/IE the first line error will gone and you can see your wiki first page without any error line.

This error is because your PHP isn't set up as an Apache module, getallheaders() may not be available. You don't actually need it though, it's just a debugging aid.



Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.

Recent comments

Facebook Fans

Sponsors

Online Store

Tag Cloud