Last modified: 2011-08-01 18:12:11 UTC
The command line installer sets: $wgServer = "http://localhost"; $wgScriptPath = "install.php"; so trying to access the newly created wiki redirects you to http://localhostinstall.php
Yeah, I can confirm that ain't pretty. I got: $wgScriptPath = "maintenance/install.php"; despite explicitly setting --scriptpath=/wiki on the command line. On CLI you can't really guess the script path (if you look higher in the path you *might* be able to fake it by recognizing common paths like /var/www or /Library/Documents/WebServer or such, it's not likely to be reliable). It shouldn't be trying to derive the path, but even if it does by default the explicit setting should be taking priority!
Would love to get this fixed. Here's a patch. diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index 6da4f10..086458e 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -842,13 +842,13 @@ abstract class Installer { // PHP_SELF isn't available sometimes, such as when PHP is CGI but // cgi.fix_pathinfo is disabled. In that case, fall back to SCRIPT_NAME // to get the path to the current script... hopefully it's reliable. SIGH - if ( !empty( $_SERVER['PHP_SELF'] ) ) { + if ( $this->getVar( 'wgScriptPath' ) ) { + // Some kind soul has set it for us already (e.g. debconf) + return true; + } elseif ( !empty( $_SERVER['PHP_SELF'] ) ) { $path = $_SERVER['PHP_SELF']; } elseif ( !empty( $_SERVER['SCRIPT_NAME'] ) ) { $path = $_SERVER['SCRIPT_NAME']; - } elseif ( $this->getVar( 'wgScriptPath' ) ) { - // Some kind soul has set it for us already (e.g. debconf) - return true; } else { $this->showError( 'config-no-uri' ); return false;
Created attachment 8853 [details] Fix Bah, linewrapping. Attached.
Patch will not work and was already attempted, see r91726.
WebInstaller should set scriptPath using SERVER globals itself (after all, it is irrelevant to the CliInstaller; what is it doing there anyway?) Then remove the checks from the base Installer.
Created attachment 8854 [details] Updated patch (tested too!) New patch.
tested and applied: r93635