A partial archive of https://discourse-mediawiki.wmflabs.org as of Saturday May 21, 2022.

Trouble in running Cargo extension

sahil505

For some reason I’m unable to run cargo extension on my localhost server. On checking my logs it shows error of Undefined index: wgVersion, Undefined variable: wgScriptPath, Undefined variable: wgResourceModules and Uncaught Error: Unsupported operand types.

I’m guessing my LocalSettings.php is not getting linked with the extensions/Cargo/Cargo.php? Although I have included the lines wfLoadExtension( 'Cargo' ); & require_once("$IP/extensions/Cargo/Cargo.php"); in the extension block in LocalSettings.php as mentioned in the README. Can someone please guide me on this.

FYI: I’m using a mac with mamp installed on it with apache and mysql servers. My path/URL for cargo extension is http://localhost:8888/core/extensions/Cargo/

Thanks.

Nikerabbit

Which version of Cargo?

Do not use both wfLoadExtension and require_once for the same extension. Use only wfLoadExtension if it is supported by the extension.

sahil505

CARGO_VERSION = 1.6.

I’ve tried with one of them as well but it doesn’t work.

srishakatux

Which version of MediaWiki are you using?

wfLoadExtension( 'Cargo' ); will only work with MediaWiki 1.25 and above.

sahil505

I’m using MediaWiki 1.31.

FlorianSW

What page do you try to open? Can you give the exact code you used in your LocalSettings.php? Does your wiki work without this extension being installed?

Btw.: What do you want to achieve with installing the extension on your localhost? Development?

My path/URL for cargo extension is http://localhost:8888/core/extensions/Cargo/
What do you mean with that?

sahil505

The page I try to open is http://localhost:8888/core/extensions/Cargo/Cargo.php

The exact code that I’m using in my LocalSettings.php for cargo extension is

wfLoadExtension( 'Cargo' );
$wgCargoDBtype = "mysql";
$wgCargoDBserver = "localhost";
$wgCargoDBname = "my_wiki";
$wgCargoDBuser = "root";
$wgCargoDBpassword = "root";

$wgShowExceptionDetails = true;
$wgShowDBErrorBacktrace = true;
$smwgEnabledCompatibilityMode = true;

And yes, I’m doing this for development purpose.

FlorianSW

The page I try to open is http://localhost:8888/core/extensions/Cargo/Cargo.php

And there’s the problem. You can’t open this page, as it is not a MediaWiki entrypoint (it misses code, that protects against that, like other extensions have it). You need to open a wikipage, probably a page, where the cargo extension is used or a special page. That highly depends on what the extension should/is being used for.

sahil505

Got it. Thanks a lot.