}
+/**
+ * Endeavor to detect what user and group PHP is currently
+ * running as. Probably only works in non-Windows environments.
+ *
+ * @return mixed Boolean FALSE is returned if something went wrong,
+ * otherwise an array is returned with the following
+ * elements:
+ * uid The current process' UID (integer)
+ * euid The current process' effective UID (integer)
+ * gid The current process' GID (integer)
+ * egid The current process' effective GID (integer)
+ * name The current process' name/handle (string)
+ * ename The current process' effective name/handle (string)
+ * group The current process' group name (string)
+ * egroup The current process' effective group name (string)
+ * Note that some of these elements may have empty
+ * values, especially if they could not be determined.
+ *
+ * @since 1.5.2
+ *
+ */
+function get_process_owner_info()
+{
+ if (!function_exists('posix_getuid'))
+ return FALSE;
+
+ $process_info['uid'] = posix_getuid();
+ $process_info['euid'] = posix_geteuid();
+ $process_info['gid'] = posix_getgid();
+ $process_info['egid'] = posix_getegid();
+
+ $user_info = posix_getpwuid($process_info['uid']);
+ $euser_info = posix_getpwuid($process_info['euid']);
+ $group_info = posix_getgrgid($process_info['gid']);
+ $egroup_info = posix_getgrgid($process_info['egid']);
+
+ $process_info['name'] = $user_info['name'];
+ $process_info['ename'] = $euser_info['name'];
+ $process_info['group'] = $user_info['name'];
+ $process_info['egroup'] = $euser_info['name'];
+
+ return $process_info;
+}
+
+
do_err($short_open_tag_warning, false);
}
+
+/* check who the web server is running as if possible */
+
+if ($process_info = get_process_owner_info()) {
+ echo $IND . 'Web server is running as user: ' . $process_info['name'] . ' (' . $process_info['uid'] . ")<br />\n";
+ //echo $IND . 'Web server is running as effective user: ' . $process_info['ename'] . ' (' . $process_info['euid'] . ")<br />\n";
+ echo $IND . 'Web server is running as group: ' . $process_info['group'] . ' (' . $process_info['gid'] . ")<br />\n";
+ //echo $IND . 'Web server is running as effective group: ' . $process_info['egroup'] . ' (' . $process_info['egid'] . ")<br />\n";
+}
+
+
/* checking paths */
echo "Checking paths...<br />\n";