
我正在嘗試透過 tarball 在 Windows (10) Linux 子系統下的 Ubuntu 18.04.4 LTS 上安裝 Mediawiki 1.34 - 顯然所有模組都正常工作:phpmyadmin、sql 資料庫、apache2。http://localhost/mediawiki/Mw-config成功運行並產生有效的 Localsettings.php
我嘗試將 mediawiki 目錄放在 /var/www/html/ 中,或放在 /var/lib/ 中,並帶有指向 /var/www/html/ 的符號鏈接,但是http://localhost/mediawiki一直告訴我:LocalSettings.php 找不到。
我已將 LocalSettings.php 放入所有可以想像的目錄中,但沒有成功。還處決了作曲家。幾個網站上有很多其他建議,但沒有任何效果。對我來說很明顯http://localhost/mediawiki/index.php已開啟:
define( 'MW_ENTRY_POINT', 'index' );
/*define( 'MW_ENTRY_POINT', '/var/www/html/mediawiki/' );*/
// Bail on old versions of PHP, or if composer has not been run yet to install
// dependencies. Using dirname( __FILE__ ) here because __DIR__ is PHP5.3+.
// phpcs:ignore MediaWiki.Usage.DirUsage.FunctionFound
require_once dirname( __FILE__ ) . '/includes/PHPVersionCheck.php';
wfEntryPointCheck( 'html', dirname( $_SERVER['SCRIPT_NAME'] ) );
require __DIR__ . '/includes/WebStart.php';
$mediaWiki = new MediaWiki();
$mediaWiki->run();
________________________________________
我可以從index.php檢索到的值如下
迴聲( $_SERVER['SCRIPT_NAME'] ); /Mediawiki/index.php echo ( dirname( $_SERVER['SCRIPT_NAME'] ) ); /Mediawiki 迴音(目錄); /var/lib/Mediawiki 回顯(文件); /var/lib/Mediawiki/index.php echo (目錄名(文件)。 '/includes/PHPVersionCheck.php'); /var/lib/Mediawiki/includes/PHPVersionCheck.php ________________________________________ 然後前往 WebStart.php ________________________________________
// If no LocalSettings file exists, try to disnano WebStart.phpnano WebStart.phpplay an error page
// (use a callback because it depends on TemplateParser)
if ( !defined( 'MW_CONFIG_CALLBACK' ) ) {
if ( !defined( 'MW_CONFIG_FILE' ) ) {
define( 'MW_CONFIG_FILE', "$IP/LocalSettings.php" );
}
if ( !is_readable( MW_CONFIG_FILE ) ) {
function wfWebStartNoLocalSettings() {
# LocalSettings.php is the per-site customization file. If it does not exist
# the wiki installer needs to be launched or the generated file uploaded to
# the root wiki directory. Give a hint, if it is not readable by the server.
global $IP;
require_once "$IP/includes/NoLocalSettings.php";
die();
}
define( 'MW_CONFIG_CALLBACK', 'wfWebStartNoLocalSettings' );
}
任何想法?
答案1
問題已經解決了。這是一個大寫/小寫的問題。 WebStart.php 尋找 LocalSettings.php,而安裝腳本則提供 Localsettings.php