MediaWiki无法获取路径 [英] MediaWiki cannot get path
本文介绍了MediaWiki无法获取路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的MediaWiki无法获取我的实时Web服务器的路径.这是代码:
My MediaWiki cannot get the path of my live web server. Here is the code:
$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>";
localhostweb服务器将回显显示为:Please <a href=wiki.website.com/mw-config/index.php\">enter</a>
,
The localhostwebserver displays the echo as: Please <a href=wiki.website.com/mw-config/index.php\">enter</a>
,
,但实时服务器将回显显示为Please <a href=\/mw-config/index.php\">enter</a>
but the live server displays the echo as Please <a href=\/mw-config/index.php\">enter</a>
那怎么可能?需要帮助!
How is that possible? Need help!
推荐答案
If you need the url of the current page in php, I can recommend this script. I have used it successfully for years.
这篇关于MediaWiki无法获取路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文