By harshadewa
Hi,
I hope these info are important. Following are already installed. OS: CentOS 7.0 x64 Apache 2.4 MySQL 5.5 PHP 5.4.36
I want to install FastCGI on this. I googled and found several tutorials. But the commands used in them are different from each other and Im confused. If someone can give me a step by step on how to install latest FastCGI on a server that already have above things, I would really appreciate it.
Thanks
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi @admin1009248,
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
<FileMatch \.php$>
SetHandler application/x-httpd-php
</FileMatch>
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:
vim /var/www/cgi-bin/php.fastcgi
The content of the file should be something like
#!/bin/bash
PHPRC="/etc/php.ini"
PHP_FCGI_CHILDREN=4
PHP_FCGI_MAX_REQUESTS=1000
export PHPRC
export PHP_FCGI_CHILDREN
export PHP_FCGI_MAX_REQUESTS
exec /usr/bin/php-cgi
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.
Regards, KDSys
This comment has been deleted
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.