fpm_main
2015-10-26 22:05:55 0 举报
fpm_main是一个用于管理FPM(FastCGI Process Manager)的主程序。FPM是一个PHP FastCGI进程管理器,它可以用来控制PHP脚本的执行。fpm_main负责启动、停止和管理FPM进程,以及处理与FPM相关的信号和事件。它还提供了一些命令行参数和配置文件选项,以便用户可以根据需要定制FPM的行为。总之,fpm_main是FPM的核心组件,它使得PHP脚本能够高效、稳定地运行在Web服务器上。
作者其他创作
大纲/内容
cgi_sapi_module.php_ini_path_override = NULL; cgi_sapi_module.php_ini_ignore_cwd = 1;
static void fcgi_setup_signals(void)
sapi_initialize_empty_request(TSRMLS_C);
fcgi_init();
sf-ini_entries = NULL;sapi_module = *sf;
int fcgi_init(void)
php_setup_sapi_content_types(TSRMLS_C);
if (read_bytes buflen) {SG(post_read) = 1; return read_bytes;
if (sapi_module.read_post) {
php_optind = orig_optind; php_optarg = orig_optarg;
SAPI_API void sapi_startup(sapi_module_struct *sf)
if (php_information) {
/* No other args are permitted here as there is no interactive mode */ if (argc != php_optind) {
init lots of SG shit
sapi_startup(&cgi_sapi_module);
sapi_post_entry *p=post_entries;while (p-content_type) { if (sapi_register_post_entry(p TSRMLS_CC) == FAILURE) {
/* startup after we get the above ini override se we get things right */ if (cgi_sapi_module.startup(&cgi_sapi_module) == FAILURE) {
sapi_globals_ctor(&sapi_globals);
case 'i': /* php info & quit */php_information = 1;
SAPI_API SAPI_POST_READER_FUNC(sapi_read_standard_form_data)
if(post_reader_func) {post_reader_func(TSRMLS_C);
fcgi_request *request = (fcgi_request*) SG(server_context);char *request_body_filename = sapi_cgibin_getenv((char *) \"REQUEST_BODY_FILE\
static void sapi_globals_ctor(sapi_globals_struct *sapi_globals TSRMLS_DC)
/* Cookies */SG(request_info).cookie_data = sapi_module.read_cookies(TSRMLS_C);
if ((SG(post_max_size) 0) && (SG(request_info).content_length SG(post_max_size))) {
static void fcgi_signal_handler(int signo) if (signo == SIGUSR1 || signo == SIGTERM) { in_shutdown = 1;
static int php_cgi_startup(sapi_module_struct *sapi_module)
zend_signal_startup();
SAPI_API int sapi_register_post_entries(sapi_post_entry *post_entries TSRMLS_DC)
SG(server_context) = NULL; SG(request_info).request_method = NULL; SG(request_info).auth_digest = SG(request_info).auth_user = SG(request_info).auth_password = NULL; SG(request_info).content_type_dup = NULL;
SG(request_info).content_type_dup = content_type;
for (x = 0; x pstorage) / sizeof(*zend_signal_globals-pstorage); ++x) { zend_signal_queue_t *queue = &zend_signal_globals-pstorage[x];
sapi_register_post_entries(php_post_entries TSRMLS_CC);
/* Called from php_request_startup() for every request.*/ SAPI_API void sapi_activate(TSRMLS_D)
static void zend_signal_globals_ctor(zend_signal_globals_t *zend_signal_globals TSRMLS_DC)
if (sapi_module.input_filter_init) {sapi_module.input_filter_init(TSRMLS_C);
static void sapi_read_post_data(TSRMLS_D)
if (sapi_module.activate) {sapi_module.activate(TSRMLS_C);
module_shutdown = 0; module_startup = 1;
case 'm': /* list compiled in modules */print_modules(TSRMLS_C);print_extensions(TSRMLS_C);
SG(read_post_bytes) += read_bytes;
is_initialized = 1;
zend_signal_globals_ctor(&zend_signal_globals);
case 'n':cgi_sapi_module.php_ini_ignore = 1;
sapi_activate(TSRMLS_C);
if(sapi_module.default_post_reader) {sapi_module.default_post_reader(TSRMLS_C);
cgi_sapi_module.additional_functions = additional_functions; cgi_sapi_module.executable_location = argv[0];
php_stream_rewind(SG(request_info).request_body);
void zend_signal_startup()
int php_setup_sapi_content_types(TSRMLS_D)
case 'y':fpm_config = php_optarg;
SAPI_API void sapi_initialize_empty_request(TSRMLS_D)
SAPI_API int sapi_register_post_entry(sapi_post_entry *post_entry TSRMLS_DC)
case 'c':cgi_sapi_module.php_ini_path_override = strdup(php_optarg);
0 条评论
回复 删除
下一页