2009
10.05

If you want to run Apache with mod_worker you will have to us PHP via FCGI. Here is how to install it on Ubuntu 9.04 Server edition.

Install required software

user@computer:$ apt-get install php5-cgi php5 libapache2-mod-fcgid

Add handler for PHP

user@computer:$ vim /etc/apache2/conf.d/php5-fastcgi

add following lines:

AddHandler fcgid-script .php
FCGIWrapper /usr/lib/cgi-bin/php5 .php

On Debian Lenny you have to add following lines:

user@computer:$ vim /etc/apache2/mods-enabled/fcgid.conf
AddHandler fcgid-script .php
FCGIWrapper /usr/bin/php5-cgi .php

You also need to add ExecCGI to directory options in you vhost config:

user@computer:$ vim /etc/apache2/sites-enabled/000-default
DocumentRoot "/var/www"
<Directory "/var/www">
        Options Indexes FollowSymLinks MultiViews ExecCGI
        AllowOverride None
        Order allow,deny
        allow from all
</Directory>

Restart Apache

user@computer:$ /etc/init.d/apache2 restart

Create PHP info page

user@computer:$ vim /var/www/info.php
<?
phpinfo();
?>
PHP5 FCGI

PHP5 FCGI

Bookmark and Share

No Comment.

Add Your Comment