正在加载...

使用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
Tags: ,
,
发表评论
表情
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]