Topic on Project:Support desk

SemanticMediaWiki error installing: Fatal error: Uncaught Error: Call to undefined function enableSemantics()

Guillaume Taillefer (talkcontribs)

I've tried everything to get this to work but nothing does. I tried following the following steps from Semantic MediaWiki's page about installing Semantic Mediawiki. I used the command mentioned for creating the composer.local.json file, and it worked (in my home directory, so outside of public_html and extensions). I then used the command to update composer, which worked. I then tried adding the

wfLoadExtension( 'SemanticMediaWiki' );

enableSemantics( '' );

commands to LocalSettings.php, however of course, since I they don't even tell you the fact that you need to install the SemanticMediaWiki extension to the extension folder, because without it it gives you the error that it couldn't find the extension, I had to try and look for the extension. Their more detailed explanation about installing it is even worse, where they don't even acknowledge that now you need to add the wfLoadExtension() function for newer MediaWiki versions (I'm on 1.38.4).

I then found this page about installation without the command line. It then links to this git hub page with the different releases. So I download the 4.0.2 and add it to the extensions folder (and unzip it, and then rename it to just SemanticMediaWiki), and now the error that it couldn't find the extension goes away, and is replaced by the Fatal error: Uncaught Error: Call to undefined function enableSemantics()...

I noticed that on the git hub page for each entry it mentioned that it needed extra dependencies. And so I went to the page for Individual file release and downloaded it (to the root folder again outside of public_html). I then followed the instructions, chmod 700 then ./, with some errors, but don't seem to affect anything. I then went back to my site, and the same error is there. Then I thought to try and put the into the SemanticMediaWiki folder in extensions, and went through the same process again with the same results. But then going back to check and the same stupid error appears.

I then tried then consulting the page that talks about this error, but its so useful that it just tells you to go back to the installation pages and re-read the instructions. Well I can't do that if there is nothing else I can do to try and fix this problem.

Any help would be appreciated, thanks

Update: It seems that part of the problem is that composer.local.json doesn't really work. I tried adding some other extensions to the required section, and when I try to load them MediaWiki doesn't recognize that they're there. I also had to try to create a new composer.json to add in the same directory that composer.phar and composer.local.json is, when I was trying to use the composer update --no-dev command again. I'm not sure what to do

Jonathan3 (talkcontribs)

You could probably use the Cargo extension instead. It's just one extension and doesn't require composer.

Guillaume Taillefer (talkcontribs)
Jonathan3 (talkcontribs)

I expect so. The first extension is by Sam Wilson, who sometimes answers questions here, and who I believe also uses Cargo. You could contact him on the extension talk page. The second extension is unmaintained so might not work with either SMW or Cargo.

Guillaume Taillefer (talkcontribs)

Alright thank you so much I'll ask him

Reply to "SemanticMediaWiki error installing: Fatal error: Uncaught Error: Call to undefined function enableSemantics()"