为什么php-fpm像没人一样运行?

我最近在我的服务器(CENTOS 6.5 x86_64标准,WHM 11.44.1(内部版本7))上安装了php-fpm,遵循这里的说明: http : //infoliser.com/how-to-configure-apache-2-2-withwith使用–php-FPM-WHM-的cPanel和- easyapache /

phpinfo()显示的服务器API现在是FPM / FastCGI。

但是,当我运行一个包含exec('id')的php脚本时,我得到:

uid=99(nobody) gid=99(nobody) groups=99(nobody)

我得到的印象是,php-fpm将作为php脚本所有者的uid来运行,而不是作为http进程的所有者(在这种情况下)。 这个页面http://php-fpm.org/说fpm有“能够启动与不同的uid / gid / chroot /环境和不同的php.ini(replacesafe_mode)的工人”。

我究竟做错了什么?

PHP-FPM不会将脚本作为脚本的所有者执行,而是作为在匹配的池configuration中configuration的用户来执行。

在我的Debian系统中,默认的池www是在/etc/php5/fpm/pool.d/www.conf定义的,它包含:

 ; Unix user/group of processes ; Note: The user is mandatory. If the group is not set, the default user's group ; will be used. user = www-data group = www-data 

你的可能会有user=nobodygroup=nobody 。 您可以创build更多的池并通过在Apache / NGINX /任何configuration中分配它们来使用它们。