1

I recently set up MediaWiki on an Apache server with PostgreSQL. It installed successfully. However, when I try to access the website, I get a blank page.

The error log reports the following.

[error] PHP Fatal error:  require_once(): Failed opening required '/var/www/mediawiki-1.19.2/LocalSettings.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/mediawiki-1.19.2/includes/WebStart.php on line 134
[error] PHP Warning:  require_once(/var/www/mediawiki-1.19.2/LocalSettings.php): failed to open stream: Permission denied in /var/www/mediawiki-1.19.2/includes/WebStart.php on line 134
[error] PHP Fatal error:  require_once(): Failed opening required '/var/www/mediawiki-1.19.2/LocalSettings.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/mediawiki-1.19.2/includes/WebStart.php on line 134

I've seen other people with similar problems and the solutions have involved using chmod on LocalSettings.php to 644 or in other cases 755. Others have said using chown to make LocalSettings match the Apache user, which is just 'apache' in my case. None of these solutions have worked for me. Does anyone have other suggestions or maybe I missed something?

  • Q: Exactly where is your "LocalSettings.php"? In directory "/var/www/mediawiki-1.19.2"? Can you "ls -l" to verify this? PS: Kudos for looking at the error log, and posting the results :) – paulsm4 Sep 12 '12 at 00:23
  • Yes, that would be the directory. –  Sep 12 '12 at 00:36
  • 3
    `Permission denied` usually means the file permissions are wrong. Perhaps `apache` is not the name under which PHP runs? –  Sep 12 '12 at 00:39
  • Off-topic; belongs on [sf] – Ex Umbris Sep 12 '12 at 05:49
  • Are you running on CentOS or some other OS with SELinux enabled? If so, you may need to chcon LocalSettings.php as well. –  Sep 12 '12 at 11:34
  • I am running CentOS with SELinux enabled. –  Sep 12 '12 at 15:39
  • I have a test file with phpinfo() showing username/group as apache(48)/48. –  Sep 12 '12 at 18:49
  • SELinux might be your problem. Have a look at the top of [this article](https://www.mediawiki.org/wiki/SELinux). I remember I also had issues when installing MediaWiki, but I cannot remember if the error message was the same as yours. I hope this helps. – Alexandre Bourlier Sep 17 '12 at 21:19

1 Answers1

1

I just ran into this same issue. For me I had just installed an extension into the mediawiki extensions folder. The problem was that the folder that my extension resided in (in my case, it was named GraphViz) did not have execute permissions. I fixed it with this:

chmod o+x GraphViz/

And everything worked again. If that doesn't work, then in the interim you can go into your LocalSettings.ph file and comment out the require_once line that is giving you trouble.

Cory Klein
  • 153
  • 6