realpath 返回空字符串
我使用 MediaWiki 但出现错误。我在档案里找到了。这段代码有一行:
$IP = realpath( '.' );
但是 $IP 返回一个空字符串,因此系统中文件的路径不起作用。 (例如,如果 $IP 为 .
或 E:/path_to_wwwroot
则有效)。我该如何解决这个问题。我的提供商是否可能阻止对 realpath 的访问?
谢谢!
I use MediaWiki but there is an error. I found it in the files. There is line with this code:
$IP = realpath( '.' );
But $IP returns an empty string, so the path to the files in the system is not working. (for example if $IP would be .
or E:/path_to_wwwroot
it works). How can I solve the problem. Is it possible that my provider blocked access to realpath?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
来源:http://php.net/manual/en/function.realpath.php
因此,您的 Web 服务器还应该有权访问 pre-webroot 目录。
Source: http://php.net/manual/en/function.realpath.php
So your web server should have access also to pre-webroot directories.
我目前在从命令行运行 PHP 时遇到了这个结果,但在 HTTP 请求中却没有。必须在某个地方进行配置或 $_SERVER 设置,如果我找到修复程序,将会更新。
I am currently experiencing this result when running PHP from command line, but not within an HTTP request. Got to be config or $_SERVER settings somewhere, will update if I find the fix.
我创建的路径不存在,请始终确保其格式正确。
这是我使用的路径:
其中
MY_PATH
没有尾随/
。The path I was creating didn't exist, make always sure that it's well formed.
This is the path I was using:
Where
MY_PATH
didn't have a trailing/
.