Let’s say you didn’t have FastCGI installed.
We’ll install it as an Apache module.
yum install php php-cli mod_fcgid
As soon as you have it installed for your PHP version, you’ll need to disable the default PHP Handler. Edit PHP configuration file for Apache - /etc/httpd/conf.d/php.conf in your favorite text editor and comment the following lines in it
Save the file and restart apache as
service httpd restart
Now you’ll need to setup your FastCGI.Nagigate to
/var/www/cgi-bin directory, If it doesn’t exist, create the directory. Then create a php.fastcgi file and add the following content to this file. Also make sure the php.ini file and php-cgi exist on your system:
The content of the file should be something like
Now you’ll need to actually have the proper ownership and you can execute the them like so
chown apache:apache /var/www/cgi-bin/php.fastcgi
chmod +x /var/www/cgi-bin/php.fastcgi
Now you have FCGI installed and you can actually use it to setup your Vhost files.