Mod_fcgid command-PHP Tutorial

Source: Internet
Author: User
Mod_fcgid command. FcgidBusyScanInterval command description: interval syntax for scanning busy time-out processes: FcgidBusyScanIntervalseconds default: FcgidBusyScanInterval120 environment: Server Configuration status: external FcgidBusyScanInterval command

Description: interval between scanning busy and time-out processes

Syntax: FcgidBusyScanInterval seconds

Default value: FcgidBusyScanInterval 120.

Environment: server configuration

Status: External

Corresponding old command: BusyScanInterval

This module performs the FcgidBusyTimeout check in this interval.

FcgidBusyTimeout command
Note: The FastCGI application will be killed after the time specified by FcgidBusyTimeout is exceeded.

Syntax: FcgidBusyTimeout seconds

Default value: FcgidBusyTimeout 300

Environment: server configuration, virtual host

Status: External

Corresponding old command: BusyTimeout

This is the maximum time limit for processing requests. If the FastCGI request exceeds the number of seconds set by FcgidBusyTimeou, the request will be terminated. The time for the check will be defined by FcgidBusyScanInterval, and the request processing will be valid within the set time. The purpose of this directive is to terminate a suspended application. The default timeout time. you may need to add an application. you can take a longer time to process the request.

FcgidBusyScanInterval 120 # corresponds to FcgidBusyTimeout and performs a check every 120 seconds

FcgidBusyTimeout 300 # fastcgi requests over 300 seconds will be terminated

FcgidConnectTimeout command
Note: Fastcgi service timed out after waiting for the set time parameter (Fastcgi connection timed out)

Syntax: FcgidConnectTimeout seconds

Default value: FcgidConnectTimeout 3

Environment: server configuration, virtual host

Status: External

Corresponding old command: IPCConnectTimeout

This is the maximum cycle time set by the Fastcgi module in windows when it tries to connect to an application. when the wait time exceeds this time, a timeout occurs. (This command is not applicable to UNIX)

FcgidErrorScanInterval command
Description: scans and exits the suspended process within the interval.

Syntax: FcgidErrorScanInterval seconds

Default value: FcgidErrorScanInterval3

Environment: server configuration

Status: External

Corresponding old command: ErrorScanInterval

This is when the interval module processes the suspended process to terminate. Terminating any process that has exceeded FcgidIdleTimeout or FcgidProcessLifeTime is waiting.

FcgidIdleScanInterval command
Note: scan interval during idle timeout

Syntax: FcgidIdleScanInterval seconds

Default value: FcgidFixPathinfo120

Environment: server configuration

Status: External

Corresponding old command: IdleScanInterval

Within the specified time interval, the process that exceeds the maximum validity period set by FcgidIdleTimeout or FcgidProcessLifeTime is terminated.

FcgidIdleTimeout command
Note: Idle Fastcgi programs will be killed after the set time is exceeded.

Syntax: FcgidIdleTimeout seconds

Default value: FcgidIdleTimeout 300

Environment: server configuration

Status: External

Corresponding old command: IdleTimeout

If the idle time exceeds the set time, the Fastcgi program that does not process the request will be terminated. the idle process check is used together with the FcgidIdleScanInterval above.

FcgidIdleScanInterval 120 # corresponds to FcgidIdleTimeout and performs a check every 120 seconds

FcgidIdleTimeout 300 # fastcgi idle process exceeding 300 seconds will be terminated

FcgidInitialEnv command
Note: Pass the environment variable value and some optional values to Fastcgi.

Syntax: FcgidInitialEnv name [value]

Default value: none

Environment: server configuration

Status: External

Corresponding old command: DefaultInitEnv

Use FcgidInitialEnv to define the environment variables passed to the FastCGI application. This command can be used multiple times

//-------------------------------------------------------//

# Php. ini file location

FcgidInitialEnv PHPRC "C:/Progra ~ 1/PHP"

//------------------------------------------------------//

# Set PHP_FCGI_MAX_REQUESTS to be greater than or equal to FcgidMaxRequestsPerProcess to prevent the php-cgi process from exiting before processing all requests

FcgidInitialEnv PHP_FCGI_MAX_REQUESTS 1000

//-------------------------------------------------------//

# Windows path settings

FcgidInitialEnv PATH "D:/usr/local/php5; C:/WINDOWS/system32; C:/WINDOWS/System32/Wbem ;"

//-----------------------------------------------------//

# Operating System Directory

FcgidInitialEnv SystemRoot "C:/Windows"
//----------------------------------------------------//

# System disk

FcgidInitialEnv SystemDrive "C :"

//-----------------------------------------------------//

# Temporary folder

FcgidInitialEnv TEMP "C:/WINDOWS/TEMP"
//----------------------------------------------------//

# Folder for storing temporary files

FcgidInitialEnv TMP "C:/WINDOWS/TEMP"
//-----------------------------------------------------//

# Operating system installation directory

FcgidInitialEnv windir "C:/WINDOWS"

FcgidProcessLifeTime.

FcgidIOTimeout command
Note: FastCGI server communication times out

Syntax: FcgidIOTimeout seconds

Default value: FcgidIOTimeout 40.

Environment: server configuration

Status: External

Corresponding old command: IPCCommTimeout

The Fastcgi application that tries to read or write will wait for work within the set time,

FcgidFixPathinfo command
Description: settings of the image PHP cgi. fix_pathinfo

Syntax: FcgidFixPathinfo 1

Default value: FcgidFixPathinfo0

Environment: server configuration

Status: External

Corresponding old command: PHP_Fix_Pathinfo_Enable

The pathinfo mode is not supported by default, and only the normal url access mode is supported. if this command is used here, the settings in php. ini will be used, as shown below:

Cgi. fix_pathinfo = 1

Pathinfo mode refers to non-traditional URL access modes, such as pseudo-static and rewrite

FcgidMaxProcesses command
Description: maximum number of php-cgi processes.

Syntax: FcgidMaxProcesses value

Default value: FcgidMaxProcesses 1000

Environment: server configuration

Status: External

Corresponding old command: MaxProcessCount

This command sets the maximum number of FastCGI processes that can be activated at one time when running the program. You have more RAM, and you can set a higher value.

FcgidMaxProcessesPerClass command
Description: maximum number of FCGI processes that can be enabled on each virtual host.

Syntax: FcgidMaxProcessesPerClass value

Default value: FcgidMaxProcessesPerClass 100.

Environment: server configuration

Status: External

Corresponding old command: defamaxmaxclassprocesscount

The default value is 100. Each virtual host can enable a maximum of 100 Fastcgi processes. that is, a single customer can have 100 PHP requests simultaneously. We recommend that you set the value from 8 to 20. Note: If there are more requests at the same time, they will be queued, rather than rejected. (The value cannot be greater than the value set by FcgidMaxProcesses)

FcgidMinProcessesPerClass command
Description: opposite to FcgidMaxProcessesPerClass

Syntax: FcgidMaxProcessesPerClass value

Default value: FcgidMaxProcessesPerClass3

Environment: server configuration

Status: External

Always 0

FcgidMaxRequestInMem command
Description: maximum size of each request stored in memory

Syntax: FcgidMaxRequestInMem bytes

Default value: FcgidMaxRequestInMem 65536.

Environment: server configuration

Status: External

This module reads the entire request body from the client and sends it to the application. Normally, the request body is stored in the memory. Once the size of the request body read from the client exceeds the byte set by FcgidMaxRequestInMem, the rest of the request body will be stored in the temporary file.

FcgidMaxRequestLen command
Description: maximum length of an Http request.

Syntax: FcgidMaxRequestLen bytes

Default value: FcgidMaxRequestLen 131072.

Environment: server configuration

Status: External

If the Http request size exceeds this amount, the request will fail and a 500 Server Error will occur. The error occurs during File upload.

Warning the default value is 1 GB before 2.3.6, and the default value is 128 kB. you should use this command to set more reasonable limits. for example, if I use 2.3.6, we should use this parameter to set it to upload larger data.

FcgidMaxRequestsPerProcess command
Description: maximum number of requests for each php-cgi process

Syntax: FcgidMaxRequestsPerProcess value

Default value: FcgidMaxRequestsPerProcess 0

Environment: server configuration, virtual host

Status: External

The maximum number of requests processed by FastCGI application processes. Check is prohibited if the value is 0.

FcgidOutputBufferSize command
Description: CGI output buffer size.

Syntax: FcgidOutputBufferSize bytes

Default: FcgidOutputBufferSize 65536

Environment: server configuration, virtual host

Status: External

Set the cgi buffer size.

FcgidProcessLifeTime command
Description: the survival time of the CGI process.

Syntax: FcgidOutputBufferSize bytes

Default: FcgidOutputBufferSize 65536

Environment: server configuration, virtual host

Status: External

An existing PHP-CGI process that is idle later than this time will be terminated if the number of processes exceeds the FcgidMinProcessesPerClass setting. Check is prohibited if the value is 0. In this process, the survival time is checked for the FcgidIdleScanInterval configured in the above frequency.

FcgidSpawnScoreUpLimit command
Description: controls the process generation speed.

Syntax: FcgidSpawnScoreUpLimit value

Default value: FcgidSpawnScoreUpLimit 10

Environment: server configuration

Status: External

Generate a speed control value. When a process is generated or terminated, this value increases and decreases over time. when this value is higher than FcgidSpawnScoreUpLimit, the process being generated will stop for a while, the value of idle or FcgidSpawnScoreUpLimit is lower than the set value. The higher the data, the faster the process will be generated.

FcgidSpawnScore command
Description: process generation speed weight.

Syntax: FcgidSpawnScore value

Default value: FcgidSpawnScore 1

Environment: server configuration

Status: External

Generate the speed weight. For each process, this value is added with the generated speed control value (FcgidSpawnScoreUpLimit ). The larger the value, the faster the CGI generation.

FcgidTerminationScore command
Note: increase the value of each terminated process activity.

Syntax: FcgidTerminationScore value

Default value: FcgidTerminationScore 2

Environment: server configuration

Status: External

Extinction weight. The larger the value, the slower the CGI process is generated.

FcgidTimeScore command
Note: subtract the value of the process activity every second (set value)

Syntax: FcgidTimeScore value

Default value: FcgidTimeScore 1

Environment: server configuration

Status: External

The higher the value, the higher the productivity of the process.

FcgidWrapper command
(CGI program location settings)

Syntax: FcgidWrapper command [suffix] [virtual]

Default value: none

Environment: server configuration

Status: External

It is generally used to specify the php-cgi path.

LoadModule fcgid_module modules/mod_fcgid.so

FcgidWrapper "C:/Progra ~ 1/PHP/php-cgi.exe"

FcgidZombieScanInterval command
Description: scan interval of botnets

Syntax: FcgidZombieScanInterval seconds

Default value: FcgidZombieScanInterval 3

Environment: server configuration

Status: External

Interval of scanning botnets.

FastCgi basic configuration
Below is a basic FastCgi configuration

Copy mod_fcgid.so to the modules folder under the Apache installation directory, open httpd. conf, and add the following content (any location ):

LoadModule fcgid_module modules/mod_fcgid.so

AddHandler fcgid-script. fcgi. php

# Php. ini file location

FcgidInitialEnv PHPRC "C:/Progra ~ 1/PHP"

# Set PHP_FCGI_MAX_REQUESTS to be greater than or equal to FcgidMaxRequestsPerProcess to prevent the php-cgi process from exiting before processing all requests

FcgidInitialEnv PHP_FCGI_MAX_REQUESTS 1000

# Php-cgi maximum number of requests for each process

FcgidMaxRequestsPerProcess 1000

# Maximum number of php-cgi processes

FcgidMaxProcesses 5

# Maximum execution time

FcgidIOTimeout 120

FcgidIdleTimeout 120

# Php-cgi path

FcgidWrapper "C:/Progra ~ 1/PHP/php-cgi.exe"

# Define the MIME-Type for ". php" files

AddType application/x-httpd-php. php

# Define the length of a cgi request

Fcgidmax requestlen 1500000

Appendix:
1. AddHandler command
Ing between file extensions and specific processors

AddHandler fcgid-script. fcgi. php

The above statement is interpreted as: Once the above definition is put in your http. conf file, all files containing the. fcgi,. php extension will be treated as FCGID programs.

2. AddType command
Ing between a given file extension and a specific content type

AddType application/x-httpd-php. php

The explanation of the above statement is: once you put the above definition in your http. conf file, all files containing the. php extension will be treated as PHP-type programs.

Interval description: interval syntax for scanning busy and time-out processes: FcgidBusyScanInterval seconds default: FcgidBusyScanInterval 120 environment: Server Configuration status: external...

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.