如何才能知道,哪个用户正在运行的当前PHP脚本? [英] How do I find out, which user is running the current php script?

查看:238
本文介绍了如何才能知道,哪个用户正在运行的当前PHP脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们如何确定PHP脚本是当我运行服务器的脚本下运行哪个用户?难道是运行相同的用户偶然Apache或phpMyAdmin的下?我的问题也许错误地诬陷,但我想知道哪些用户,这样我设置适当的权限在/ var

How do we determine which user the php script is running under when I run the script on server? Is it running under the same user as apache or phpmyadmin by chance? My question maybe wrongly framed but I want to know which user so that I set appropriate permission for different folders in /var

推荐答案

执行 WHOAMI

<?php echo exec('whoami'); ?>

这篇关于如何才能知道,哪个用户正在运行的当前PHP脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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