如何找到网站的物理路径 [英] How can I find the physical path of my site
本文介绍了如何找到网站的物理路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我必须将图像上传到我的图像目录.我在localhost上工作.我知道我需要告诉图像目录的物理路径来上传图像.在我的本地主机中,我知道图像目录的物理路径是"c:\ wamp \ www \ mysite \ images".但是在生产环境中,我怎么知道图像目录的物理路径是什么?
I have to upload images to my images directory. I am working on localhost yet. I know that I need to tell the physical path of images directory to upload the images. In my localhost I know that images directory physical path is "c:\wamp\www\mysite\images". But In a Production Environment How can I know that what is the physical path of images directory?
推荐答案
尝试 ^ ](提到的方法数量,其中一些可能对您有用).
Try this link[^] (number of ways mentioned, some might be of use to you).
我强烈建议您您将文档根目录用作文件系统锚".相对于您的所有(数据,而不是代码)路径-在PHP中,路径为
I''d strongly recommend that you use your document root as your filesystem "anchor". Make all your (data, not code) paths relative to that - in PHP, it would be
_SERVER[''DOCUMENT_ROOT''](或
_SERVER[''DOCUMENT_ROOT''] (or
这篇关于如何找到网站的物理路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文