xref: /PHP-7.4/sapi/fpm/fpm/fpm_conf.h (revision e546d721)
1 	/* (c) 2007,2008 Andrei Nigmatulin */
2 
3 #ifndef FPM_CONF_H
4 #define FPM_CONF_H 1
5 
6 #include <stdint.h>
7 #include "php.h"
8 
9 #define PM2STR(a) (a == PM_STYLE_STATIC ? "static" : (a == PM_STYLE_DYNAMIC ? "dynamic" : "ondemand"))
10 
11 #define FPM_CONF_MAX_PONG_LENGTH 64
12 
13 struct key_value_s;
14 
15 struct key_value_s {
16 	struct key_value_s *next;
17 	char *key;
18 	char *value;
19 };
20 
21 /*
22  * Please keep the same order as in fpm_conf.c and in php-fpm.conf.in
23  */
24 struct fpm_global_config_s {
25 	char *pid_file;
26 	char *error_log;
27 #ifdef HAVE_SYSLOG_H
28 	char *syslog_ident;
29 	int syslog_facility;
30 #endif
31 	int log_level;
32 	int log_limit;
33 	int log_buffering;
34 	int emergency_restart_threshold;
35 	int emergency_restart_interval;
36 	int process_control_timeout;
37 	int process_max;
38 	int process_priority;
39 	int daemonize;
40 	int rlimit_files;
41 	int rlimit_core;
42 	char *events_mechanism;
43 #ifdef HAVE_SYSTEMD
44 	int systemd_watchdog;
45 	int systemd_interval;
46 #endif
47 };
48 
49 extern struct fpm_global_config_s fpm_global_config;
50 
51 /*
52  * Please keep the same order as in fpm_conf.c and in php-fpm.conf.in
53  */
54 struct fpm_worker_pool_config_s {
55 	char *name;
56 	char *prefix;
57 	char *user;
58 	char *group;
59 	char *listen_address;
60 	int listen_backlog;
61 	/* Using chown */
62 	char *listen_owner;
63 	char *listen_group;
64 	char *listen_mode;
65 	char *listen_allowed_clients;
66 	int process_priority;
67 	int process_dumpable;
68 	int pm;
69 	int pm_max_children;
70 	int pm_start_servers;
71 	int pm_min_spare_servers;
72 	int pm_max_spare_servers;
73 	int pm_process_idle_timeout;
74 	int pm_max_requests;
75 	char *pm_status_path;
76 	char *ping_path;
77 	char *ping_response;
78 	char *access_log;
79 	char *access_format;
80 	char *slowlog;
81 	int request_slowlog_timeout;
82 	int request_slowlog_trace_depth;
83 	int request_terminate_timeout;
84 	int request_terminate_timeout_track_finished;
85 	int rlimit_files;
86 	int rlimit_core;
87 	char *chroot;
88 	char *chdir;
89 	int catch_workers_output;
90 	int decorate_workers_output;
91 	int clear_env;
92 	char *security_limit_extensions;
93 	struct key_value_s *env;
94 	struct key_value_s *php_admin_values;
95 	struct key_value_s *php_values;
96 #ifdef HAVE_APPARMOR
97 	char *apparmor_hat;
98 #endif
99 #ifdef HAVE_FPM_ACL
100 	/* Using Posix ACL */
101 	char *listen_acl_users;
102 	char *listen_acl_groups;
103 #endif
104 };
105 
106 struct ini_value_parser_s {
107 	char *name;
108 	char *(*parser)(zval *, void **, intptr_t);
109 	intptr_t offset;
110 };
111 
112 enum {
113 	PM_STYLE_STATIC = 1,
114 	PM_STYLE_DYNAMIC = 2,
115 	PM_STYLE_ONDEMAND = 3
116 };
117 
118 int fpm_conf_init_main(int test_conf, int force_daemon);
119 int fpm_worker_pool_config_free(struct fpm_worker_pool_config_s *wpc);
120 int fpm_conf_write_pid();
121 int fpm_conf_unlink_pid();
122 
123 #endif
124