Topic on Project:Support desk

Problems with composer in a new (clean) install of MW 1.34 (or 1.33)

7
Mgreis (talkcontribs)

I'm looking for some help with Composer on a new (clean) install of Mediawiki and SMW.

As background, I've been using SMW for 5+ years. Like many - I suspect - my use of Composer is pretty much limited to what's needed to install and maintain SMW. My installation is at MW 1.28 and SMW 3.0.1. There was a pretty significant problem with MW 1.30+, PHP 7 and Sphinx Search, so I haven't been able to consider upgrading in some time. At this point, the challenges of going from MW 1.28 -> 1.34 and PHP 5.6 to PHP 7.2 have made upgrading my current wiki a dubious proposition.

Instead, I am creating a new MW 1.34 wiki on a new server, installing my extensions and planning to export my pages from the current wiki and import them into the new wiki. That's the plan, anyway....

When I install MW 1.34 (on a cPanel-based server, so cPanel does the installation), there is no composer.json file in the root directory of the wiki. I can't put SMW in a composer.local.json file and have it recognized.

I can create a minimal composer.json with one or two extensions. However, when the update script is later run and I'm prompted to run composer to create a lock file, a whole bunch of libraries required by MW are removed. It took me the better part of a day to realize what was happening (since the first symptom was a HTTP 500 error). My research uncovered some of the syntax required in composer.json to look for the composer.local.json file and to look for other composer.json files in the MW directory structure, but it's not clear what I need to have in composer.json to ensure that everything MW needs to run is accounted for along with SMW.

I looked back at my current MW 1.28 implementation, and the composer.json file has a lot of statements that were clearly provided by MW, along with my additions for SMW. Somewhere between my first implementation and this, that seems to have changed.


I've been trying to forensically recreate a composer.json that would at least not blow away my MW but that is proving difficult and doesn't make a lot of sense to me.  Why should I re-create a file that MW absolutely must have to operate once composer is used? I may be missing something, but I'm at a loss to understand what.


Any help would be appreciated!

Bawolff (talkcontribs)

honestly,my main advice would be to not use cpanel to install mediawiki but use the official tarball.

Mgreis (talkcontribs)

That's the next step I'm trying.

But can you or anyone tell me, am I correct that there should be a composer.json in the base directory after I've unzipped and installed it? That's the rub. If I can use composer to install SMW and my other extensions without destroying the installation, I should be good to go.

And if not, how do I get/create a composer.json to install extensions without wrecking the installation?


Thanks, @Bawolff

Bawolff (talkcontribs)

afaik the tarball should have a composer.json. mw core dependencies are preinstalled but its there just in case. I think. I havent looked at the tarball recently.


The whole installing extensions via composer isnt really officially reccomended but the smw people seem very insistent on it :S

Mgreis (talkcontribs)

Oh, dear. I don't want to get into the middle of one of those conversations. To your first point, the core dependencies are pre-installed. The problem is that the creation of a minimal composer.json file for one or more of these extensions is eventually followed by having to run either a composer update or a maintenance/update.php script. That results in the removal of those pre-installed, required libraries because they are not referenced in the minimal composer.json. Removing the libraries results in a non-functional wiki and a reinstall.


That, in a nutshell, is my problem. I'm having this conversation in parallel now on the semediawiki-user mailing and hoping that one of these sources helps me find a way out of this mess.


Bawolff (talkcontribs)

whats the library that is missing after composer update? The included composer.json should list all the dependencies needed to run mediawiki

Jwbaker-dr (talkcontribs)

User:Mgreis - just chipping in to add that this thread was a total lifesaver! I'd installed Mediawiki via cpanel and was stuck at Install Dependencies at Wikibase/Installation because there was no composer.json in there. After failing around for a bit, I stumbled across this thread, which then prompted me to do a local install to see if that has a composer.json and it did! Super weird that the cpanel version is missing that. Anyway, all working now.

Reply to "Problems with composer in a new (clean) install of MW 1.34 (or 1.33)"