Bug 1718580
Summary: | "LocalSettings.php not found" despite being present | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Scott Schmit <i.grok> |
Component: | mediawiki | Assignee: | Michael Cronenworth <mike> |
Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | high | Docs Contact: | |
Priority: | unspecified | ||
Version: | 30 | CC: | Axel.Thimm, claywj, daveg, mike, puiterwijk, rbottomley |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2019-09-13 22:33:33 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Scott Schmit
2019-06-08 19:23:02 UTC
Are you following the README.RPM instructions and using the 'mw-createinstance' script to initialize your instance? It also has instructions to point your Apache config to the '$IP' directory. Are you following those instructions? I started out by doing an upgrade from a working installation (so I used mw-updateallinstances). When that didn't work, I tried (among many things) reinitializing my instance from scratch: I generated a new LocalSettings.php from scratch, merging in settings from the original that weren't addressed by the mw-config helper/installer. So I've done it both ways. As for pointing my apache config at the $IP directory... I didn't make the wiki a DocumentRoot, but I do have an "Alias /wiki /srv/.../wiki" directive. Is that no longer sufficient? That is one option described in the template /etc/httpd/conf.d/mediawiki.conf for setting up a mediawiki instance. Looks like upstream *reverted* a change to support sym-linked includes... https://phabricator.wikimedia.org/rMW3aa0b0567ff64ecb74df7534c8812c78c323df7c The relevant snippet from includes.WebStart.php, version 1.31.0: # Full path to working directory. # Makes it possible to for example to have effective exclude path in apc. # __DIR__ breaks symlinked includes, but realpath() returns false # if we don't have permissions on parent directories. $IP = getenv( 'MW_INSTALL_PATH' ); if ( $IP === false ) { $IP = realpath( '.' ) ?: dirname( __DIR__ ); } Tried modifying my installation to match the old way but it breaks eveything else! index.php is not the only entry point. Is there a way to set the MW_INSTALL_PATH environment variable from a .user.ini file or apache configuration that will work with php-fpm? That might avoid the path resolution issues. I, too, had a working install that after an update keeps wanting me to set up LocalSettings.php. I just did a fresh install on a VM and it still doesn't work. So, I actually looked at this earlier, and you can set MW_INSTALL_PATH to fix this. Example httpd config: https://infrastructure.fedoraproject.org/cgit/ansible.git/tree/roles/mediawiki/templates/mediawiki-app.conf.j2#n23 . After some messing about I have a working wiki! As suggested by the fedinfra ansible role I have changed my httpd mediawiki.conf to: # Short URL support. Alias "/wiki" "/document root/w/index.php" <Directory "document root/w"> # Work around mediawiki symlink issues. SetEnv MW_INSTALL_PATH "document root/w" AllowOverride None Require all granted </Directory> # Upload directory. <Directory " /document root/w/images"> Options FollowSymLinks AllowOverride FileInfo </Directory> Adjust "document root" to suit. Should still support multiple instances so long as MW_INSTALL_PATH is configured correctly in each (same as /etc/mediawiki/instances). Tested with a PHP debug file to call phpinfo()... MW_INSTALL_PATH shows up in the _$_SEVER environment and it looks like the mdiawiki code is happy with that. No need to change the PHP-FPM pool configuration. Still works *without* clear_env = no. Probably best to regenerate LocalSettings.php - skins have been dropped etc. since mediawiki-1.29.3, my last working setup. Leaving my old one in place threw even more errors. Delete or rename your LocalSettings.php and start a new installation; /mw-config/index.php... Following DaveG's response, my mediawiki.conf looks like: <Directory /var/www/html/wiki/foo> SetEnv MW_INSTALL_PATH "/var/www/html/wiki/foo" AllowOverride None Require all granted </Directory> And it works for access but the mw-config/index.php script to upgrade the database still tries to look for LocalSettings.php in /usr/share/mediawiki. One can still fill out the forms and it will upgrade the db but the expected behavior is to discover the local setup and prompt to upgrade. Steps to reproduce: 1. clear site cookies in test browser 2. access http://site/wiki/foo/mw-config/ 3. choose language and you are prompted with steps for a new setup 4. copy LocalSettings.php to /usr/share/mediawiki 5. clear site cookies in test browser 6. access http://site/wiki/foo/mw-config/ 7. choose language and you are promoted for the upgrade key fwiw, command line "fix" for above: cd /usr/share/mediawiki/maintenance/; export MW_INSTALL_PATH=/var/www/html/wiki/foo; php update.php I'll update the examples and documentation to include the environment setting. |