Topic on Project:Support desk

LocalSettings.php Not Found after upgrading MediaWiki 1.32 on Fedora

14
182.239.180.188 (talkcontribs)

(Scarcely a new topic, but I don't seem to be able to add to previous posts)

I am upgrading to 1.32.1 on Fedora 30, having done a fresh install on a new server, but using the (upgraded) database from the previous version, 1.26 of F24. I have the LocalSettings.php file in my wiki folder, in my case /var/www/wiki, alongside index.php etc. After running through all the previous answers to this problem, checking permissions, SELinux, etc, I tracked the call to LocalSettings to includes/WebStart.php, and found it was looking for it in the install dir, /usr/share/mediawiki. I added a soft link there back to the "proper" LocalSettings.php and all was fine.

So I don't really have a question, except "Is this how it should work ?" - I rather gather not - and I thought I should pass on the experience.

John

Ciencia Al Poder (talkcontribs)

That's probably a problem on Fedora package.

MediaWiki is usually placed directly on the web server root and not on a totally unrelated folder.

2601:18A:C401:307C:5EEB:B79F:F84A:B998 (talkcontribs)

John - thank you for your post. I had the same issue, upgrading from Fedora 29/ MediaWiki 1.29 to F30 and MW 1.32.1. Installed at the root - /var/www/html. Your softlink idea fixed the issue for me as well. I have no idea if that is how it is supposed to be, but I read this will cause issues with people that run multiple wiki's on the same server.

KazuyoshiFurutaka (talkcontribs)

It seems that the problem is caused by the change in the following statements in includes/WebStart.php, from

IP = getenv( 'MW_INSTALL_PATH' );

if ( $IP === false ) {

        $IP = realpath( '.' ) ?: dirname( __DIR__ );

}

to

IP = getenv( 'MW_INSTALL_PATH' );

if ( $IP === false ) {

        $IP = dirname( __DIR__ );

}


Without realpath('.'), the files can NOT work with symlinks and can NOT easily shared by multiple wikis on a single site (because $IP is NOT set correctly).

Indeed, I have a few mediawiki wikis on a single machine running Fedora 30, and after updating to 1.32.2 rpm they don't run.

Could you put the realpath('.') statement back ???

Thanks in advance.

Kazuyoshi

Ciencia Al Poder (talkcontribs)

You can set the MW_INSTALL_PATH environment variable in apache so it finds the correct path. See the SetEnv Apache directive.

KazuyoshiFurutaka (talkcontribs)
Ciencia Al Poder (talkcontribs)

I don't know how is your "wiki farm" set up, so it will largely depend on how do you define different settings for each wiki

240F:80:B046:1:69EF:D187:FC64:FDDA (talkcontribs)

Very simple.

There're several wiki directories under /var/www/wiki (e.g. /var/www/wiki/wikiA, /var/www/wiki/wikiB, ...) and there's a LocalSettings.php in each directory; mediawiki files in the common /usr/share/mediawiki directory are shared via simlinks.

(I'm afraid a single httpd configuration (say MW_INSTALL_PATH) is shared by the wikis)

Kazuyoshi

Ciencia Al Poder (talkcontribs)

Set MW_INSTALL_PATH to /usr/share/mediawiki, and WIKI_PATH to wikiA in the first case, or wikiB in the second, and then inside the LocalSettings of /usr/share/mediawiki require_once('/var/www/wiki/' . $_ENV['WIKI_PATH'] . '/LocalSettings.php');

KazuyoshiFurutaka (talkcontribs)

By the way, what are the reasons of the removal?

Kazuyoshi

Ciencia Al Poder (talkcontribs)
98.194.73.219 (talkcontribs)

See bugzilla 1718580, specifically (DaveG 2019-07-14 02:14:09 UTC). I cannot include the link so posting the basics here. This is FC30 specific and addin to what Ciencia already pointed out,

Add a Directory entry for each wiki to /etc/httpd/conf.d/mediawiki.conf like below and restart httpd.

<Directory /some/wiki/dir>

    SetEnv MW_INSTALL_PATH "/some/wiki/dir"

    AllowOverride None

    Require all granted

</Directory>

If you get an error 500 after and are upgrading, check /var/log/php-fpm/www-error.log as it's probably choking loading something not included with the latest build. Remove it from LocalSettings.php and it should work.

165.225.60.127 (talkcontribs)

I too struggled with the FC30 changes in mediawiki. And, thanks to Johns comments am back and running again. This had me stumped for several weeks since I just did not have the time to research it. Now, something that worked for the past 10 years was broken in FC30, with no clear information on how to fix it -- is very sad.

I am also trying to now figure out how to run multiple wikis and that is broken. Ciencia Al Poder -- appreciate your comments, but they are too terse for the normal person. May help those who do not need help and can figure it out with a few hints. Will greatly appreciate the code fragments and in which files.. I just tried to do it in mediawiki.conf found in /etc/httpd/conf/conf.d -- but failed.


ram

Ciencia Al Poder (talkcontribs)
Reply to "LocalSettings.php Not Found after upgrading MediaWiki 1.32 on Fedora"