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 0:23
  • Yes, that would be the directory.
    – E L
    Sep 12 '12 at 0:36
  • 3
    Permission denied usually means the file permissions are wrong. Perhaps apache is not the name under which PHP runs?
    – nneonneo
    Sep 12 '12 at 0:39
  • Off-topic; belongs on Server Fault
    – Ex Umbris
    Sep 12 '12 at 5:49
  • Are you running on CentOS or some other OS with SELinux enabled? If so, you may need to chcon LocalSettings.php as well.
    – Christian
    Sep 12 '12 at 11:34

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy