PHP显示当前服务器路径 [英] PHP display current server path

查看:142
本文介绍了PHP显示当前服务器路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在php中设置路径,但是我目前不知道该路径.

I need to setup a path in my php but I currently don't know the path.

我需要配置上载目录的路径

I need to configure the paths the the uploads directory

如下所示:

/srv/www/uploads/

我的uploads.php文件在根目录中...如此

My uploads.php file is in the root...so

www/uploads/ ???

无论如何,有没有可以让PHP告诉我当前路径的信息?

Is there anyway that I could get php to tell me my current path?

推荐答案

如果您调用 getcwd 它应该为您提供路径:

If you call getcwd it should give you the path:

<?php
  echo getcwd();
?>

这篇关于PHP显示当前服务器路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆