我的MediaWiki无法获取我的实时网络服务器的路径。这是代码:
$script = $_SERVER['SCRIPT_NAME'];
$path = pathinfo( $script, PATHINFO_DIRNAME ) . '/';
$path = str_replace( '//', '/', $path );
$ext = pathinfo( $script, PATHINFO_EXTENSION );
echo "Please <a href=\"" . htmlspecialchars( $path ) . "mw-config/index." . htmlspecialchars( $ext ) . "\">enter</a>";
localhostwebserver将echo显示为:Please <a href=wiki.website.com/mw-config/index.php\">enter</a>
,
但是实时服务器将回显显示为Please <a href=\/mw-config/index.php\">enter</a>
怎么可能?需要帮助!