How do I find out, which user is running the current php script?

前端 未结 5 1042
生来不讨喜
生来不讨喜 2021-01-11 14:21

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 quest

5条回答
  •  醉话见心
    2021-01-11 14:56

    Use this:

    echo get_current_user();
    

    Make sure to read the comments because it looks like this answer doesn't actually do what you want.

提交回复
热议问题