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 >> |