PHP-FPM Configuration Detailed

Source: Internet
Author: User
Tags fpm http 200 socket dedicated server

  This article mainly introduces the PHP-FPM configuration, the need for friends can refer to the following

php5.3 php-fpm   Code as follows:/usr/local/php/etc/php-fpm.conf     PID = run/php-fpm.pid PID settings, default in the installation directory Var/run /php-fpm.pid, it is recommended to open   Error_log = log/php-fpm.log error log, default in the installation directory Var/log/php-fpm.log   Log_level = notice error level. Available levels are: alert (must be processed immediately), error (Errors), warning (warning condition), notice (general important information), debug (debug information). Default: Notice.   Emergency_restart_threshold = Emergency_restart_interval = 60s indicates in Emergency_restart_ The number of php-cgi processes with SIGSEGV or sigbus errors within the set value of interval if more than Emergency_restart_threshold, PHP-FPM will gracefully restart. These two options generally keep the default values.   Process_control_timeout = 0 Sets the timeout for the child process to accept the main process multiplexing signal. Available units: s (seconds), M (minutes), H (Hours), or D (day) default units: S (sec). Default value: 0.   daemonize = yes background execution FPM, the default is yes, if you can change to no for debugging.   in FPM, you can use different settings to run multiple process pools. These settings can be set individually for each process pool.   Listen = 127.0.0.1:9000 fpm listening port, which is the address of PHP processing in Nginx, the general default value can be. Available formats are: ' Ip:port ', ' Port ', '/path/to/unix/socket '. Each process pool needs to be set.   Listen.backlog =-1 Backlog number,-1 for unrestricted, the operating system decided that this line comment out.   listen.allowed_clients = 127.0.0.1 Allow access to the IP of the fastcgi process, set any to not restrict IP, such asTo set up other host Nginx can also access this FPM process, listen to set the cost of access to IP. The default value is any. Each address is separated by commas. If not set or empty, allow any server request connection   Listen.owner = www listen.group = www listen.mode = 0666 unix socket settings option, if TCP access is available, comment here 。   user = www group = account and Group of www boot process   PM = dynamic How to control child processes with static and dynamic options. If you select static, Pm.max_children specifies the number of fixed child processes. If dynamic is selected, it is determined by the lower open parameter: Pm.max_children, the maximum number of pm.start_servers, the number of processes at startup Pm.min_spare_servers to ensure the minimum number of idle processes, if the idle process is less than this value, A new subprocess Pm.max_spare_servers is created to guarantee the maximum number of idle processes and, if the idle process is greater than this value, the PM can be set to static for the dedicated server.   Pm.max_requests = 1000 Sets the number of requests for services before each subprocess is reborn. is useful for Third-party modules that may have memory leaks. If set to ' 0′, the request is always accepted. Equivalent to php_fcgi_max_requests environment variables. Default value: 0.   Pm.status_path = URL of/status fpm status page. If it is not set, the status page cannot be accessed. Default value: None.   Ping.path = ping URL of/ping fpm monitor page. If it is not set, the ping page cannot be accessed. This page is used to externally detect if FPM is alive and can respond to requests. Please note that you must start with a slash (/).   Ping.response = Pong is used to define the return corresponding to the ping request. Returns the Text/plain-formatted text for HTTP 200. Default value: Pong.   Request_terminate_timeout = 0 Sets the time-out period for a single request. This option may affect the ' max_execution ' in the php.ini setting_time ' is useful for scripts that are not aborted for some special reason. Set to ' 0′ ' indicates ' off '. You can try to change this option when a 502 error occurs frequently.   Request_slowlog_timeout = 10s When a timeout is requested for this setting, the corresponding PHP call stack information is fully written to the slow log. Set to ' 0′ ' indicates ' off '   Slowlog = log/$pool. Log.slow Slow request logging, match request_slowlog_timeout use   rlimit_files = 1024 Set file to hit The rlimit limit for opening descriptors. Default value: System-Defined value system default open handle is 1024, you can use Ulimit-n view, ulimit-n 2048 modify.   Rlimit_core = 0 Sets the core rlimit maximum limit value. Available values: ' Unlimited ', 0, or positive integer. Default value: System-defined value.   chroot = chroot directory at startup. The defined directory needs to be an absolute path. If it is not set, then chroot is not used.   CHDIR = Sets the startup directory, which is automatically chdir to the directory when it is started. The defined directory needs to be an absolute path. Default value: Current directory, or/directory (chroot)   Catch_workers_output = yes redirect stdout and stderr to the primary error log file in the run process. If there are no settings, stdout and stderr will be redirected to/dev/null according to the FASTCGI rules. Default value: null.  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.