Using PHP with Mod_fcgid

Source: Internet
Author: User
Reprint Address: 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/apache2/mods-enabled/fcgid.conf b Y Adding the "ipccommtimeout" directive


AddHandler Fcgid-script. fcgi
Socketpath/var/lib/apache2/fcgid/sock

# communication Timeout:default value is 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 would 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, 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 a using this value, which means.
# 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 >>
  • 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.