Lines Matching refs:wp

598 	struct fpm_worker_pool_s *wp;  in fpm_worker_pool_config_alloc()  local
600 wp = fpm_worker_pool_alloc(); in fpm_worker_pool_config_alloc()
602 if (!wp) { in fpm_worker_pool_config_alloc()
606 wp->config = malloc(sizeof(struct fpm_worker_pool_config_s)); in fpm_worker_pool_config_alloc()
608 if (!wp->config) { in fpm_worker_pool_config_alloc()
609 fpm_worker_pool_free(wp); in fpm_worker_pool_config_alloc()
613 memset(wp->config, 0, sizeof(struct fpm_worker_pool_config_s)); in fpm_worker_pool_config_alloc()
614 wp->config->listen_backlog = FPM_BACKLOG_DEFAULT; in fpm_worker_pool_config_alloc()
615 wp->config->pm_process_idle_timeout = 10; /* 10s by default */ in fpm_worker_pool_config_alloc()
616 wp->config->process_priority = 64; /* 64 means unset */ in fpm_worker_pool_config_alloc()
617 wp->config->process_dumpable = 0; in fpm_worker_pool_config_alloc()
618 wp->config->clear_env = 1; in fpm_worker_pool_config_alloc()
621 fpm_worker_all_pools = wp; in fpm_worker_pool_config_alloc()
626 tmp->next = wp; in fpm_worker_pool_config_alloc()
633 current_wp = wp; in fpm_worker_pool_config_alloc()
634 return wp->config; in fpm_worker_pool_config_alloc()
687 static int fpm_evaluate_full_path(char **path, struct fpm_worker_pool_s *wp, char *default_prefix, … in fpm_evaluate_full_path() argument
696 if (wp && wp->config) { in fpm_evaluate_full_path()
697 prefix = wp->config->prefix; in fpm_evaluate_full_path()
740 if (**path != '/' && wp != NULL && wp->config) { in fpm_evaluate_full_path()
749 struct fpm_worker_pool_s *wp, *wp2; in fpm_conf_process_all_pools() local
756 for (wp = fpm_worker_all_pools; wp; wp = wp->next) { in fpm_conf_process_all_pools()
759 if (wp->config->prefix && *wp->config->prefix) { in fpm_conf_process_all_pools()
760 fpm_evaluate_full_path(&wp->config->prefix, NULL, NULL, 0); in fpm_conf_process_all_pools()
762 if (!fpm_conf_is_dir(wp->config->prefix)) { in fpm_conf_process_all_pools()
763 …"[pool %s] the prefix '%s' does not exist or is not a directory", wp->config->name, wp->config->pr… in fpm_conf_process_all_pools()
769 if (!wp->config->user && !geteuid() && !fpm_globals.run_as_root) { in fpm_conf_process_all_pools()
770 zlog(ZLOG_ALERT, "[pool %s] user has not been defined", wp->config->name); in fpm_conf_process_all_pools()
775 if (wp->config->listen_address && *wp->config->listen_address) { in fpm_conf_process_all_pools()
776 wp->listen_address_domain = fpm_sockets_domain_from_address(wp->config->listen_address); in fpm_conf_process_all_pools()
778 if (wp->listen_address_domain == FPM_AF_UNIX && *wp->config->listen_address != '/') { in fpm_conf_process_all_pools()
779 fpm_evaluate_full_path(&wp->config->listen_address, wp, NULL, 0); in fpm_conf_process_all_pools()
782 zlog(ZLOG_ALERT, "[pool %s] no listen address have been defined!", wp->config->name); in fpm_conf_process_all_pools()
786 …if (wp->config->process_priority != 64 && (wp->config->process_priority < -19 || wp->config->proce… in fpm_conf_process_all_pools()
787 zlog(ZLOG_ERROR, "[pool %s] process.priority must be included into [-19,20]", wp->config->name); in fpm_conf_process_all_pools()
792 …if (wp->config->pm != PM_STYLE_STATIC && wp->config->pm != PM_STYLE_DYNAMIC && wp->config->pm != P… in fpm_conf_process_all_pools()
793 …zlog(ZLOG_ALERT, "[pool %s] the process manager is missing (static, dynamic or ondemand)", wp->con… in fpm_conf_process_all_pools()
798 if (wp->config->pm_max_children < 1) { in fpm_conf_process_all_pools()
799 zlog(ZLOG_ALERT, "[pool %s] pm.max_children must be a positive value", wp->config->name); in fpm_conf_process_all_pools()
804 if (wp->config->pm == PM_STYLE_DYNAMIC) { in fpm_conf_process_all_pools()
805 struct fpm_worker_pool_config_s *config = wp->config; in fpm_conf_process_all_pools()
808 …zlog(ZLOG_ALERT, "[pool %s] pm.min_spare_servers(%d) must be a positive value", wp->config->name, … in fpm_conf_process_all_pools()
813 …zlog(ZLOG_ALERT, "[pool %s] pm.max_spare_servers(%d) must be a positive value", wp->config->name, … in fpm_conf_process_all_pools()
819 … and pm.max_spare_servers(%d) cannot be greater than pm.max_children(%d)", wp->config->name, confi… in fpm_conf_process_all_pools()
824 … pm.max_spare_servers(%d) must not be less than pm.min_spare_servers(%d)", wp->config->name, confi… in fpm_conf_process_all_pools()
830 …zlog(ZLOG_NOTICE, "[pool %s] pm.start_servers is not set. It's been set to %d.", wp->config->name,… in fpm_conf_process_all_pools()
833 …n pm.min_spare_servers(%d) and not greater than pm.max_spare_servers(%d)", wp->config->name, confi… in fpm_conf_process_all_pools()
836 } else if (wp->config->pm == PM_STYLE_ONDEMAND) { in fpm_conf_process_all_pools()
837 struct fpm_worker_pool_config_s *config = wp->config; in fpm_conf_process_all_pools()
840 … ONLY be used when events.mechanisme is either epoll (Linux) or kqueue (*BSD).", wp->config->name); in fpm_conf_process_all_pools()
845 …zlog(ZLOG_ALERT, "[pool %s] pm.process_idle_timeout(%ds) must be greater than 0s", wp->config->nam… in fpm_conf_process_all_pools()
850 …as too low for the ondemand process manager. I updated it for you to %d.", wp->config->name, confi… in fpm_conf_process_all_pools()
861 if (wp->config->pm_status_path && *wp->config->pm_status_path) { in fpm_conf_process_all_pools()
863 char *status = wp->config->pm_status_path; in fpm_conf_process_all_pools()
866 …zlog(ZLOG_ERROR, "[pool %s] the status path '%s' must start with a '/'", wp->config->name, status); in fpm_conf_process_all_pools()
871 zlog(ZLOG_ERROR, "[pool %s] the status path '%s' is not long enough", wp->config->name, status); in fpm_conf_process_all_pools()
877 …s path '%s' must contain only the following characters '[alphanum]/_-.~'", wp->config->name, statu… in fpm_conf_process_all_pools()
884 if (wp->config->ping_path && *wp->config->ping_path) { in fpm_conf_process_all_pools()
885 char *ping = wp->config->ping_path; in fpm_conf_process_all_pools()
889 zlog(ZLOG_ERROR, "[pool %s] the ping path '%s' must start with a '/'", wp->config->name, ping); in fpm_conf_process_all_pools()
894 zlog(ZLOG_ERROR, "[pool %s] the ping path '%s' is not long enough", wp->config->name, ping); in fpm_conf_process_all_pools()
900 … path '%s' must containt only the following characters '[alphanum]/_-.~'", wp->config->name, ping); in fpm_conf_process_all_pools()
905 if (!wp->config->ping_response) { in fpm_conf_process_all_pools()
906 wp->config->ping_response = strdup("pong"); in fpm_conf_process_all_pools()
908 if (strlen(wp->config->ping_response) < 1) { in fpm_conf_process_all_pools()
909 …RROR, "[pool %s] the ping response page '%s' is not long enough", wp->config->name, wp->config->pi… in fpm_conf_process_all_pools()
914 if (wp->config->ping_response) { in fpm_conf_process_all_pools()
915 free(wp->config->ping_response); in fpm_conf_process_all_pools()
916 wp->config->ping_response = NULL; in fpm_conf_process_all_pools()
921 if (wp->config->access_log && *wp->config->access_log) { in fpm_conf_process_all_pools()
922 fpm_evaluate_full_path(&wp->config->access_log, wp, NULL, 0); in fpm_conf_process_all_pools()
923 if (!wp->config->access_format) { in fpm_conf_process_all_pools()
924 wp->config->access_format = strdup("%R - %u %t \"%m %r\" %s"); in fpm_conf_process_all_pools()
928 if (wp->config->request_terminate_timeout) { in fpm_conf_process_all_pools()
929 …globals.heartbeat ? MIN(fpm_globals.heartbeat, (wp->config->request_terminate_timeout * 1000) / 3)… in fpm_conf_process_all_pools()
933 if (wp->config->slowlog && *wp->config->slowlog) { in fpm_conf_process_all_pools()
934 fpm_evaluate_full_path(&wp->config->slowlog, wp, NULL, 0); in fpm_conf_process_all_pools()
938 if (wp->config->request_slowlog_timeout) { in fpm_conf_process_all_pools()
940 if (! (wp->config->slowlog && *wp->config->slowlog)) { in fpm_conf_process_all_pools()
941 … "[pool %s] 'slowlog' must be specified for use with 'request_slowlog_timeout'", wp->config->name); in fpm_conf_process_all_pools()
948 …zlog(ZLOG_WARNING, "[pool %s] 'request_slowlog_timeout' is not supported on your system", wp->conf… in fpm_conf_process_all_pools()
952 wp->config->request_slowlog_timeout = 0; in fpm_conf_process_all_pools()
955 if (wp->config->slowlog && *wp->config->slowlog) { in fpm_conf_process_all_pools()
958 fd = open(wp->config->slowlog, O_WRONLY | O_APPEND | O_CREAT, S_IRUSR | S_IWUSR); in fpm_conf_process_all_pools()
961 zlog(ZLOG_SYSERROR, "Unable to create or open slowlog(%s)", wp->config->slowlog); in fpm_conf_process_all_pools()
967 …_globals.heartbeat ? MIN(fpm_globals.heartbeat, (wp->config->request_slowlog_timeout * 1000) / 3) … in fpm_conf_process_all_pools()
969 …if (wp->config->request_terminate_timeout && wp->config->request_slowlog_timeout > wp->config->req… in fpm_conf_process_all_pools()
970 …greater than 'request_terminate_timeout' (%d)", wp->config->name, wp->config->request_slowlog_time… in fpm_conf_process_all_pools()
976 if (wp->config->request_slowlog_trace_depth) { in fpm_conf_process_all_pools()
978 if (! (wp->config->slowlog && *wp->config->slowlog)) { in fpm_conf_process_all_pools()
979 …ool %s] 'slowlog' must be specified for use with 'request_slowlog_trace_depth'", wp->config->name); in fpm_conf_process_all_pools()
986 …NING, "[pool %s] 'request_slowlog_trace_depth' is not supported on your system", wp->config->name); in fpm_conf_process_all_pools()
991 if (wp->config->request_slowlog_trace_depth <= 0) { in fpm_conf_process_all_pools()
992 …%s] 'request_slowlog_trace_depth' (%d) must be a positive value", wp->config->name, wp->config->re… in fpm_conf_process_all_pools()
996 wp->config->request_slowlog_trace_depth = 20; in fpm_conf_process_all_pools()
1000 if (wp->config->chroot && *wp->config->chroot) { in fpm_conf_process_all_pools()
1002 fpm_evaluate_full_path(&wp->config->chroot, wp, NULL, 1); in fpm_conf_process_all_pools()
1004 if (*wp->config->chroot != '/') { in fpm_conf_process_all_pools()
1005 …zlog(ZLOG_ERROR, "[pool %s] the chroot path '%s' must start with a '/'", wp->config->name, wp->con… in fpm_conf_process_all_pools()
1009 if (!fpm_conf_is_dir(wp->config->chroot)) { in fpm_conf_process_all_pools()
1010 …l %s] the chroot path '%s' does not exist or is not a directory", wp->config->name, wp->config->ch… in fpm_conf_process_all_pools()
1016 if (wp->config->chdir && *wp->config->chdir) { in fpm_conf_process_all_pools()
1018 fpm_evaluate_full_path(&wp->config->chdir, wp, NULL, 0); in fpm_conf_process_all_pools()
1020 if (*wp->config->chdir != '/') { in fpm_conf_process_all_pools()
1021 …zlog(ZLOG_ERROR, "[pool %s] the chdir path '%s' must start with a '/'", wp->config->name, wp->conf… in fpm_conf_process_all_pools()
1025 if (wp->config->chroot) { in fpm_conf_process_all_pools()
1028 spprintf(&buf, 0, "%s/%s", wp->config->chroot, wp->config->chdir); in fpm_conf_process_all_pools()
1031 … path '%s' ('%s') does not exist or is not a directory", wp->config->name, wp->config->chdir, wp->… in fpm_conf_process_all_pools()
1038 if (!fpm_conf_is_dir(wp->config->chdir)) { in fpm_conf_process_all_pools()
1039 …ol %s] the chdir path '%s' does not exist or is not a directory", wp->config->name, wp->config->ch… in fpm_conf_process_all_pools()
1046 if (!wp->config->security_limit_extensions) { in fpm_conf_process_all_pools()
1047 wp->config->security_limit_extensions = strdup(".php .phar"); in fpm_conf_process_all_pools()
1050 if (*wp->config->security_limit_extensions) { in fpm_conf_process_all_pools()
1058 security_limit_extensions = strdup(wp->config->security_limit_extensions); in fpm_conf_process_all_pools()
1073 wp->limit_extensions = malloc(sizeof(char *) * (nb_ext + 1)); in fpm_conf_process_all_pools()
1074 if (!wp->limit_extensions) { in fpm_conf_process_all_pools()
1075 zlog(ZLOG_ERROR, "[pool %s] unable to malloc extensions array", wp->config->name); in fpm_conf_process_all_pools()
1080 security_limit_extensions = strdup(wp->config->security_limit_extensions); in fpm_conf_process_all_pools()
1087 wp->limit_extensions[nb_ext++] = strdup(ext); in fpm_conf_process_all_pools()
1091 wp->limit_extensions[nb_ext] = NULL; in fpm_conf_process_all_pools()
1097 if (!wp->config->chroot) { in fpm_conf_process_all_pools()
1102 for (kv = wp->config->php_values; kv; kv = kv->next) { in fpm_conf_process_all_pools()
1105 fpm_evaluate_full_path(&kv->value, wp, NULL, 0); in fpm_conf_process_all_pools()
1109 for (kv = wp->config->php_admin_values; kv; kv = kv->next) { in fpm_conf_process_all_pools()
1115 fpm_evaluate_full_path(&kv->value, wp, NULL, 0); in fpm_conf_process_all_pools()
1123 for (wp = fpm_worker_all_pools; wp; wp = wp->next) { in fpm_conf_process_all_pools()
1125 if (wp == wp2) { in fpm_conf_process_all_pools()
1129 …if (wp->config->listen_address && *wp->config->listen_address && wp2->config->listen_address && *w… in fpm_conf_process_all_pools()
1130 …et listen address as it's already used in another pool '%s'", wp2->config->name, wp->config->name); in fpm_conf_process_all_pools()
1182 struct fpm_worker_pool_s *wp; in fpm_conf_post_process() local
1247 for (wp = fpm_worker_all_pools; wp; wp = wp->next) { in fpm_conf_post_process()
1248 if (!wp->config->access_log || !*wp->config->access_log) { in fpm_conf_post_process()
1251 if (0 > fpm_log_write(wp->config->access_format)) { in fpm_conf_post_process()
1252 …zlog(ZLOG_ERROR, "[pool %s] wrong format for access.format '%s'", wp->config->name, wp->config->ac… in fpm_conf_post_process()
1334 struct fpm_worker_pool_s *wp; in fpm_conf_ini_parser_section() local
1344 for (wp = fpm_worker_all_pools; wp; wp = wp->next) { in fpm_conf_ini_parser_section()
1345 if (!wp->config) continue; in fpm_conf_ini_parser_section()
1346 if (!wp->config->name) continue; in fpm_conf_ini_parser_section()
1347 if (!strcasecmp(wp->config->name, Z_STRVAL_P(section))) { in fpm_conf_ini_parser_section()
1349 current_wp = wp; in fpm_conf_ini_parser_section()
1597 struct fpm_worker_pool_s *wp; in fpm_conf_dump() local
1628 for (wp = fpm_worker_all_pools; wp; wp = wp->next) { in fpm_conf_dump()
1630 if (!wp->config) continue; in fpm_conf_dump()
1631 zlog(ZLOG_NOTICE, "[%s]", STR2STR(wp->config->name)); in fpm_conf_dump()
1632 zlog(ZLOG_NOTICE, "\tprefix = %s", STR2STR(wp->config->prefix)); in fpm_conf_dump()
1633 zlog(ZLOG_NOTICE, "\tuser = %s", STR2STR(wp->config->user)); in fpm_conf_dump()
1634 zlog(ZLOG_NOTICE, "\tgroup = %s", STR2STR(wp->config->group)); in fpm_conf_dump()
1635 zlog(ZLOG_NOTICE, "\tlisten = %s", STR2STR(wp->config->listen_address)); in fpm_conf_dump()
1636 zlog(ZLOG_NOTICE, "\tlisten.backlog = %d", wp->config->listen_backlog); in fpm_conf_dump()
1638 zlog(ZLOG_NOTICE, "\tlisten.acl_users = %s", STR2STR(wp->config->listen_acl_users)); in fpm_conf_dump()
1639 zlog(ZLOG_NOTICE, "\tlisten.acl_groups = %s", STR2STR(wp->config->listen_acl_groups)); in fpm_conf_dump()
1641 zlog(ZLOG_NOTICE, "\tlisten.owner = %s", STR2STR(wp->config->listen_owner)); in fpm_conf_dump()
1642 zlog(ZLOG_NOTICE, "\tlisten.group = %s", STR2STR(wp->config->listen_group)); in fpm_conf_dump()
1643 zlog(ZLOG_NOTICE, "\tlisten.mode = %s", STR2STR(wp->config->listen_mode)); in fpm_conf_dump()
1644 …zlog(ZLOG_NOTICE, "\tlisten.allowed_clients = %s", STR2STR(wp->config->listen_allowed_clients)… in fpm_conf_dump()
1645 if (wp->config->process_priority == 64) { in fpm_conf_dump()
1648 zlog(ZLOG_NOTICE, "\tprocess.priority = %d", wp->config->process_priority); in fpm_conf_dump()
1650 zlog(ZLOG_NOTICE, "\tprocess.dumpable = %s", BOOL2STR(wp->config->process_dumpable)); in fpm_conf_dump()
1651 zlog(ZLOG_NOTICE, "\tpm = %s", PM2STR(wp->config->pm)); in fpm_conf_dump()
1652 zlog(ZLOG_NOTICE, "\tpm.max_children = %d", wp->config->pm_max_children); in fpm_conf_dump()
1653 zlog(ZLOG_NOTICE, "\tpm.start_servers = %d", wp->config->pm_start_servers); in fpm_conf_dump()
1654 zlog(ZLOG_NOTICE, "\tpm.min_spare_servers = %d", wp->config->pm_min_spare_servers); in fpm_conf_dump()
1655 zlog(ZLOG_NOTICE, "\tpm.max_spare_servers = %d", wp->config->pm_max_spare_servers); in fpm_conf_dump()
1656 zlog(ZLOG_NOTICE, "\tpm.process_idle_timeout = %d", wp->config->pm_process_idle_timeout); in fpm_conf_dump()
1657 zlog(ZLOG_NOTICE, "\tpm.max_requests = %d", wp->config->pm_max_requests); in fpm_conf_dump()
1658 zlog(ZLOG_NOTICE, "\tpm.status_path = %s", STR2STR(wp->config->pm_status_path)); in fpm_conf_dump()
1659 zlog(ZLOG_NOTICE, "\tping.path = %s", STR2STR(wp->config->ping_path)); in fpm_conf_dump()
1660 zlog(ZLOG_NOTICE, "\tping.response = %s", STR2STR(wp->config->ping_response)); in fpm_conf_dump()
1661 zlog(ZLOG_NOTICE, "\taccess.log = %s", STR2STR(wp->config->access_log)); in fpm_conf_dump()
1662 zlog(ZLOG_NOTICE, "\taccess.format = %s", STR2STR(wp->config->access_format)); in fpm_conf_dump()
1663 zlog(ZLOG_NOTICE, "\tslowlog = %s", STR2STR(wp->config->slowlog)); in fpm_conf_dump()
1664 zlog(ZLOG_NOTICE, "\trequest_slowlog_timeout = %ds", wp->config->request_slowlog_timeout); in fpm_conf_dump()
1665 zlog(ZLOG_NOTICE, "\trequest_slowlog_trace_depth = %d", wp->config->request_slowlog_trace_depth); in fpm_conf_dump()
1666 zlog(ZLOG_NOTICE, "\trequest_terminate_timeout = %ds", wp->config->request_terminate_timeout); in fpm_conf_dump()
1667 zlog(ZLOG_NOTICE, "\trlimit_files = %d", wp->config->rlimit_files); in fpm_conf_dump()
1668 zlog(ZLOG_NOTICE, "\trlimit_core = %d", wp->config->rlimit_core); in fpm_conf_dump()
1669 zlog(ZLOG_NOTICE, "\tchroot = %s", STR2STR(wp->config->chroot)); in fpm_conf_dump()
1670 zlog(ZLOG_NOTICE, "\tchdir = %s", STR2STR(wp->config->chdir)); in fpm_conf_dump()
1671 …zlog(ZLOG_NOTICE, "\tcatch_workers_output = %s", BOOL2STR(wp->config->catch_workers_output)); in fpm_conf_dump()
1672 zlog(ZLOG_NOTICE, "\tclear_env = %s", BOOL2STR(wp->config->clear_env)); in fpm_conf_dump()
1673 zlog(ZLOG_NOTICE, "\tsecurity.limit_extensions = %s", wp->config->security_limit_extensions); in fpm_conf_dump()
1675 for (kv = wp->config->env; kv; kv = kv->next) { in fpm_conf_dump()
1679 for (kv = wp->config->php_values; kv; kv = kv->next) { in fpm_conf_dump()
1683 for (kv = wp->config->php_admin_values; kv; kv = kv->next) { in fpm_conf_dump()