dongzhang5787 2015-03-11 12:15
浏览 276
已采纳

$ _SERVER ['HOME']没有显示正确的值nginx ubuntu

I have a nginx server with php5-fpm on ubuntu 14.

when I echo $_SERVER['HOME'] it return back /var/www

my web files located in /usr/share/nginx/html

obviously it's not my home directory if i type ~/ in the terminal I can get the home directory that is /home/myname

I couldn't find where this information set and why it set wrong.

  • 写回答

2条回答 默认 最新

  • dongtan4046 2015-03-11 12:19
    关注

    $_SERVER['HOME'] returns the home path of the current user.

    If nginx is running as (for example) www-data, then you'll get the home-directory of www-data.

    I guess that you need $_SERVER['DOCUMENT_ROOT'].

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 怎么获取下面的: glove_word2id.json和 glove_numpy.npy 这两个文件
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug