I just installed php5-cgi on my Ubuntu 12.04. I am not sure about:
- What configuration I will need to do in nginx config file to use it.
- How will I start the service, as sudo service php5-cgi says "unrecognized service"
The package php5-cgi
doesn't include a service that can be started.
From the package description:
This package provides the /usr/lib/cgi-bin/php5 CGI interpreter built for use in Apache 2 with mod_actions, or any other CGI httpd that supports a similar mechanism. Note that MOST Apache users probably want the libapache2-mod-php5 package.
Therefore you need an installed web server like Apache.
To enable php5-cgi
create a symbolic link
sudo ln -s /etc/apache2/conf-available/php5-cgi.conf /etc/apache2/conf-enabled
and change the configuration via
sudo nano /etc/apache2/conf-enabled/php5-cgi.conf
An other option to enable an apache2 module is a2enmod
. Therefore you could also use
sudo a2enmod php5-cgi
After that don't forget to restart the apache2 service
sudo service apache2 restart
as commented by @ThomasW.
for
nginx
you should be usingphp5-fpm
, NOTphp5-cgi
nginx
you should be using php5-fpm
which is what the nginx people recommend, and NOT php5-cgi
.