我正在尝试通过 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 放在了所有你能想到的目录中,但都没有成功。还执行了 composer。在几个网站上有很多其他建议,但都不起作用。对我来说,很明显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 检索到的值如下
echo($_SERVER['SCRIPT_NAME']);/Mediawiki/index.php echo(dirname($_SERVER['SCRIPT_NAME']));/Mediawiki echo(目录); /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