Page MenuHomePhabricator

interwiki transclusion fails with "Cannot redeclare class HttpRequest" error
Closed, ResolvedPublic

Description

Author: pavelmalahov

Description:
I have a wiki-farm but cannot make interwiki transclution works.

That's what I checked:

  • iw_trans flag in interwiki tables is ON (=1)
  • $wgEnableScaryTranscluding = true;
  • Template is accessible by any (including anonymous) user
  • MediaWiki core was not touched
  • No extension used (now they switched on)

That's what I need:

There is a template Common in pool wiki - the wiki of common resources for all wikis in the project
http://en.teopedia.org/pool/Template:Common

Transcluding works in it's own wiki just fine (see the bottom):
http://en.teopedia.org/pool/Main_Page

I've tried to put the line
{{t-en-pool:Common}}

Or
{{t-en-pool:Template:Common}}

to the another wiki in the same farm:
http://en.teopedia.org/wiki/Main_Page

where "t-en-pool" is a prefix in the shared interwiki table, which can be verified in
http://en.teopedia.org/wiki/Special:Interwiki

and see a blank page in my browser. In PHP log on server I read:

[error] [client 127.0.0.8] PHP Fatal error: Cannot redeclare class HttpRequest in /local-path-to-mw-engine/includes/HttpFunctions.php on line 122, referer: http://en.teopedia.org/w-wiki/index....ge&action=edit

There is the same error on MediaWiki 1.16.2, 1.16.4, 1.16.5

Is it something wrong in PHP configuration on my server? Or is it a MediaWiki bug?

My configuration:

MediaWiki 1.16.5
PHP 5.3.6 (apache2handler)
MySQL 5.0.77-log


Version: 1.16.x
Severity: normal

Details

Reference
bz28929

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 11:28 PM
bzimport set Reference to bz28929.
bzimport added a subscriber: Unknown Object (MLST).

Its because you have the HTTP php extension installed (aka this one: http://www.php.net/manual/en/intro.http.php ) which is not compatible with MediaWiki before 1.17. You need to either disable that extension, or upgrade to at least 1.17.

pavelmalahov wrote:

As I said in description above, I have disabled all MediaWiki extensions and still have the same problem. Now I've disabled them again, which can be verified in
http://en.teopedia.org/wiki/Special:Version

And still can not use transcluding - the PHP error is the same.

Or perhaps you mean not a MediaWiki extension, but something else? What "HTTP php extension" did you mean?

Or perhaps you mean not a MediaWiki extension, but something else? What "HTTP
php extension" did you mean?

The php extension (which is fairly different from a mediawiki extension). The one I gave a link to in comment 1. To verify which php extensions are installed you have to create a php file containing just "<?php phpinfo()" (without the quotes), and view it in your web browser.

You probably need to disable it in your php.ini file, or perhaps run the command
$pecl uninstall HTTP (or perhaps using your system's package manager)

Anyways, removing it probably varies with how you have your system set up. If you're using a shared host, you'll probably have to talk to whomever you buy web hosting from.

Anyways, this naming conflict should probably be fixed with the 1.17 release of MediaWiki (bug 25872)

(Closing as duplicate of bug 25872. The issue is fixed in a later version, bugzilla is not a support forum, so I don't see any reason to keep this open)

  • This bug has been marked as a duplicate of bug 25872 ***