• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

Using PHP with mod_fcgid

php 搞代码 3年前 (2022-01-23) 15次浏览 已收录 0个评论

转载地址:http://typo3.org/development/articles/using-php-with-mod-fcgid/page/3/

<< Advantages of mod_fcgid Configuration Additional configuration >>

Configuration

Remove mod_php4 / mod_php5 if not already done

# a2dismod php4
# a2dismod php5

Enable mod_actions and mod_fcgid

# a2enmod actions
# a2enmod fcgid

Raise the communication timeout (= maximum execution time) for FCGI applications in /etc/apach本@文来源[email protected]搞@^&代*@码网(搞代gaodaima码e2/mods-enabled/fcgid.conf by adding the “IPCCommTimeout” directive

AddHandler fcgid-script .fcgi
SocketPath /var/lib/apache2/fcgid/sock

# Communication timeout: Default value is 20 seconds
IPCCommTimeout 60

# Connection timeout: Default value is 3 seconds

#IPCConnectTimeout 3

Create a new file /etc/apache2/conf.d/php-fcgid.conf:

# Path to php.ini ? defaults to /etc/phpX/cgi
DefaultInitEnv PHPRC=/etc/php5/cgi

# Number of PHP childs that will be launched. Leave undefined to let PHP decide.
#DefaultInitEnv PHP_FCGI_CHILDREN 3

# Maximum requests before a process is stopped and a new one is launched
#DefaultInitEnv PHP_FCGI_MAX_REQUESTS 5000

# Define a new handler “php-fcgi” for “.php” files, plus the action that must follow
AddHandler php-fcgi .php
Action php-fcgi /fcgi-bin/php-fcgi-wrapper

# Define the MIME-Type for “.php” files
AddType application/x-httpd-php .php

# Define alias “/fcgi-bin/”. The action above is using this value, which means that
# you could run another “php5-cgi” command by just changing this alias
Alias /fcgi-bin/ /var/www/fcgi-bin.d/php5-default/

# Turn on the fcgid-script handler for all files within the alias “/fcgi-bin/”

SetHandler fcgid-script
Options +ExecCGI

Next, create the directory which is chosen by the alias, and put in a symlink to the php5-cgi binary

# mkdir /var/www/fcgi-bin.d/php5-default
# ln -s /usr/bin/php5-cgi /var/www/fcgi-bin.d/php5-default/php-fcgi-wrapper

Finally, restart Apache

# /etc/init.d/apache2 restart

<< Advantages of mod_fcgid Additional configuration >>

搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:Using PHP with mod_fcgid

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址