Steps to replicate the issue (include links if applicable):
- Download the mediawiki tar.gz, extract, set up database following the instructions at https://www.mediawiki.org/wiki/Manual:Installing_MediaWiki
- Navigate to the path /w/index.php or the script path that was set up and follow installation instructions.
- Add a single quote in your wiki name during installation. (For example, Rusty's Wiki)
What happens?:
Upon successful installation, navigate to the main page of your wiki. You will be greeted by a blank page, and the HTTP status code is 500 (Internal Server Error).
The following error showed in the error log for me (using Apache):
[Wed Aug 14 15:01:23.748204 2024] [php:error] [pid 14638] [client 10.0.0.108:65072] PHP Parse error: syntax error, unexpected identifier "s" in /var/lib/mediawiki/LocalSettings.php on line 24
Navigating to line 24, I found this:
$wgSitename = 'Rusty's Wiki'; $wgMetaNamespace = 'Rusty's_Wiki';
Once I escaped the single quotes, the wiki worked.
$wgSitename = 'Rusty\'s Wiki'; $wgMetaNamespace = 'Rusty\'s_Wiki';
What should have happened instead?:
The single quotes should have been escaped during installation. I spent around half an hour searching for possible causes of a 500 error in MediaWiki, because I was not expecting a generated file, of all things, to have a syntax error.
Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia): 1.42.1
Other information (browser name/version, screenshots, etc.): N/A