上一篇: Linux 中用(pkill)踢用户
使用root执行php-fpm
[ 2010/06/03 15:17 | by selboo ]
找到文件 $src_path/sapi/cgi/fpm/fpm_unix.c里边有段代码
增加红色字段
==========================================
#define I_REALLY_WANT_ROOT_PHP
#ifndef I_REALLY_WANT_ROOT_PHP
if (wp->set_uid == 0 || wp->set_gid == 0) {
zlog(ZLOG_STUFF, ZLOG_ERROR, "please specify user and group other than root, pool ‘%s’", wp->config->name);
return -1;
}
#endif
}
else { /* not root */
if (wp->config->user && *wp->config->user) {
zlog(ZLOG_STUFF, ZLOG_WARNING, "’user’ directive is ignored, pool ‘%s’", wp->config->name);
}
if (wp->config->group && *wp->config->group) {
zlog(ZLOG_STUFF, ZLOG_WARNING, "’group’ directive is ignored, pool ‘%s’", wp->config->name);
}
if (wp->config->chroot && *wp->config->chroot) {
zlog(ZLOG_STUFF, ZLOG_WARNING, "’chroot’ directive is ignored, pool ‘%s’", wp->config->name);
}
{ /* set up HOME and USER anyway */
struct passwd *pwd;
pwd = getpwuid(getuid());
if (pwd) {
wp->user = strdup(pwd->pw_name);
wp->home = strdup(pwd->pw_dir);
}
}
}
return 0;
}
===========================
之后重新编译即可
最后编辑: selboo 编辑于2010/06/03 15:18