This shows you the differences between two versions of the page.
— |
getinfo [2016/05/09 10:34] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | Attempting to get info | ||
+ | |||
+ | <php> | ||
+ | |||
+ | if(function_exists(' | ||
+ | // use posix to get current uid and gid | ||
+ | $uid = posix_geteuid(); | ||
+ | $usr = posix_getpwuid($uid); | ||
+ | $user = $usr[' | ||
+ | $gid = posix_getegid(); | ||
+ | $grp = posix_getgrgid($gid); | ||
+ | $group = $grp[' | ||
+ | }else{ | ||
+ | // try to create a file and read it's ids | ||
+ | $tmp = tempnam ('/ | ||
+ | $uid = fileowner($tmp); | ||
+ | $gid = filegroup($tmp); | ||
+ | |||
+ | // try to run ls on it | ||
+ | $out = `ls -l $tmp`; | ||
+ | $lst = explode(' | ||
+ | $user = $lst[2]; | ||
+ | $group = $lst[3]; | ||
+ | unlink($tmp); | ||
+ | } | ||
+ | |||
+ | echo "Your PHP process seems to run with the UID $uid ($user) and the GID $gid ($group)\n"; | ||
+ | </ | ||
+ | |||
+ | <php> | ||
+ | phpinfo(); | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | This is some <span style=" | ||
+ | </ | ||
+ | < | ||
+ | <p style=" | ||
+ | </ | ||
+ | |||