On one of my servers, Apache2 is running as daemon user:
[root@sbecby07 ~]# ps -ef | grep httpd
root 1114 29432 0 10:13 pts/2 00:00:00 grep httpd
root 29773 1 0 09:03 ? 00:00:00 /usr/local/apache2/bin/httpd -k start
daemon 29774 29773 0 09:03 ? 00:00:01 /usr/local/apache2/bin/httpd -k start
daemon 29775 29773 0 09:03 ? 00:00:02 /usr/local/apache2/bin/httpd -k start
daemon 29795 29773 0 09:03 ? 00:00:03 /usr/local/apache2/bin/httpd -k start
daemon 29858 29773 0 09:03 ? 00:00:00 /usr/local/apache2/bin/httpd -k start
However, when I view phpinfo()
via a simple PHP file on the browser, it shows that PHP is running as root (with /root
homedir and all):
How is this possible? How do I change the user PHP is running as to be the same as Apache2?
The other servers I am managing do not have this issue.
User daemon
andGroup daemon
so I don't think the issue is within Apache2. I'm suspecting the user is switched somehow somewhere within PHP execution but I don't know where to start.