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