Topic on Project:Support desk

Upgrade MediaWiki 1.37.2 to 1.38.1 EU

9
Arviestarman (talkcontribs)

I have tried to upgrade my MediaWiki 1.37.2 to 1.38.1:

- Copied the images folder in the new version

- Added my extra extensions in the extensions folder of the new version

- Copied de LocalSettings.php (but commented-out all extensions)

Running 'php maintenance/update.php' gives the error

"Fatal error: Uncaught FatalError: $wgBaseDirectory must not be modified in settings files! Use the MW_INSTALL_PATH environment variable to override the installation root directory. in /var/www/html/includes/Setup.php:237

Stack trace:

#0 /var/www/html/maintenance/doMaintenance.php(96): require_once()

#1 /var/www/html/maintenance/update.php(264): require_once('/var/www/html/m...')

#2 {main}

  thrown in /var/www/html/includes/Setup.php on line 237"


Also, going to the site , gives the error:

"Fatal error: Uncaught FatalError: $wgBaseDirectory must not be modified in settings files! Use the MW_INSTALL_PATH environment variable to override the installation root directory. in /var/www/html/includes/Setup.php:237 Stack trace: #0 /var/www/html/includes/WebStart.php(93): require_once() #1 /var/www/html/index.php(44): require('/var/www/html/i...') #2 {main} thrown in /var/www/html/includes/Setup.php on line 237"


How can I solve this error?

Bawolff (talkcontribs)

Are you setting $wgBaseDirectory in LocalSettings.php ?

Arviestarman (talkcontribs)

No, I have not set the $wgBaseDirectory.

Bawolff (talkcontribs)

Unless MW_INSTALL_PATH or wgBaseDirectory have been modified, I have no idea. Try removing any extensions/customizations in LocalSettings.php to try and narrow down the cause.

Pmathewd (talkcontribs)

I have the same Problem as well. As you using a wiki farm with a symbolic link too? Otherwise i have not clue about why $wgBaseDirectory is complaining

PaulTimperley (talkcontribs)

I had a similar problem to this. I found that there were some settings in LocalSettings.php that caused the problem: relating to $IP and MW_INSTALL_PATH. I guess I should have removed them at a previous version upgrade but didn't.

To ensure a clean version of LocalSettings.php I installed a new version of 1.38.1 on a test site, then compared the old and new LocalSettings.php, editing the old one accordingly. That then worked OK in the old site.

62.104.194.32 (talkcontribs)

I also have this error, but I am unable to recreate a clean LocalSettings.php. Can someone point out what else I can do?

Tenbergen (talkcontribs)

I had the same error. In my case it has to do with a section of "security" related stuff at the top of my localsettings.php. These are old wikis, and I don't remember where this came from, but once I removed the following section my wiki loads again.

	require_once( "$IP/includes/DefaultSettings.php" );

(edits: removed part that doesn't break it)

142.58.181.234 (talkcontribs)

Thank-you, Tenbergen: your removal of that "require_once" statement fixed my issues (unable to run update.php and Apache not serving)

Reply to "Upgrade MediaWiki 1.37.2 to 1.38.1 EU"