访问 public_html 级别之外/以下的文件 [英] Access files outside/below public_html level
问题描述
如何通过位于 /home/uzair/etc/index.php
中的 url 访问文件?即使我运行域(something.com
)它也会向我显示(/home/uzair/public_html/index.php
)这个文件的数据.
How can I access files via a url that are placed in /home/uzair/etc/index.php
? Even when I run domain (something.com
) it shows me data of (/home/uzair/public_html/index.php
) this file.
任何人请帮助我如何访问放置在我的域 (something.com
) 上的 (/home/uzair/etc/index.php
)
Anyone please help me that how can I access that placed in (/home/uzair/etc/index.php
) on my domain (something.com
)
- 家
- 乌扎尔
- 等
- index.php
- 管理员
- index.php
推荐答案
听起来您在
something.com
中,它在网络上对您可见,因此它位于内public_html
但您想包含文件系统中更高级别的文件.It sounds like you are in
something.com
which is visible to you on the web so it is located inside ofpublic_html
but you want to include a file that is higher up in the file system.如果这就是您要执行的操作,请使用:
If that is what you are looking to do, use:
include("../etc/index.php");
..
告诉服务器您要访问下一个级别的文件.The
..
tells the server that you want to access the files in the next level up.如果你这样做了:
include("../../uzair/etc/index.php");
这会让您一直到
home
,如果您愿意,您可以从那里访问更多文件.That would have taken you all the way up to
home
and from there you would have access to many more files if you wanted to.public_html 之外的文件受到保护,不会在网络上被看到.许多人使用该功能作为其内容的安全性.如果您有一个文件想要显示其内容,则必须使用 include('file.php');或 include_once('file.php');甚至 require_once('file.php') 在公共盟友可见文件中.也就是您在 public_html 中拥有的文件必须是调用更高级别文件的文件.如果我理解你的问题是正确的,那就是应该如何做的.让我知道这是否回答了您的问题:-)
Files outside of public_html are protected from being seen on the web. Many people use that feature as a security to their content. If you have a file on there that you want to show contents of though, you have to use the include('file.php'); or include_once('file.php'); or even require_once('file.php') in a public ally visible file. Aka a file you have in public_html has to be the one to call the higher up file. If I am understanding your question right, that is how it is supposed to be done. Let me know if that is answering your question or not:-)
如何运行不在
public_html
中的文件?How you can run files not in
public_html
?public_html 之外的文件受到保护,不会在网络上被看到.许多人使用该功能作为其内容的安全性.如果您有一个文件想要显示其内容,则必须使用
include('file.php');
或include_once('file.php');
甚至require_once('file.php')
在一个公开的盟友可见文件中.也就是您在public_html
中的文件必须是调用上级文件的文件.如果我理解你的问题是正确的,那就是应该怎么做.Files outside of public_html are protected from being seen on the web. Many people use that feature as a security to their content. If you have a file on there that you want to show contents of though, you have to use the
include('file.php');
orinclude_once('file.php');
or evenrequire_once('file.php')
in a public ally visible file. Aka a file you have inpublic_html
has to be the one to call the higher up file. If I am understanding your question right, that is how it is supposed to be done.这篇关于访问 public_html 级别之外/以下的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
- 等
- 乌扎尔