Welcome! Log In Create A New Profile

Advanced

Query regarding Nginx working with FastCGI

Rishab Jain
July 11, 2011 05:24AM
Hi guys,

I'm facing an issue and was wondering if anybody could help me with this.

I have an Ubuntu server, and I have installed all the softwares required
using apt-get. Now, I have installed Nginx using the same mechanism as
well. I want to use the Nginx for serving php scripts from the browser
too. So therefore, after going through the web, I learn't that we need
FastCGI to be installed.

Now, as soon as the installation was complete, I restarted Nginx server
and tried accessing the php file. Instead of executing the script, it
was actually showing me the php code on the browser. It wasn't untill I
executed the following command:
/usr/bin/spawn-fcgi -a 127.0.0.1 -p 9090 -u www-data -g www-data -f
/usr/bin/php5-cgi -P /var/run/fastcgi-php.pid

As soon as I executed this command, and, restarted Nginx again, I was
able to execute the PHP script.

Now, my issue is since fastcgi is being binded by a port, it means that
there's a kind of a daemon running. So, going forward, if I make this
server live, and, by any chance the fastcgi daemon crashes, the ubuntu
will start throwing up my php code to the users (which is obviously
never desired).

I actually want to know a way we can prevent the php code from getting
displayed to the user, irrespective of whether the fastcgi is running or
not.

regards,
Rishab

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Query regarding Nginx working with FastCGI

Rishab Jain July 11, 2011 05:24AM

Re: Query regarding Nginx working with FastCGI

Jim Ohlstein July 11, 2011 06:14AM

Re: Query regarding Nginx working with FastCGI

António P. P. Almeida July 11, 2011 10:14AM

Re: Query regarding Nginx working with FastCGI

Jim Ohlstein July 11, 2011 10:52AM

Re: Query regarding Nginx working with FastCGI

António P. P. Almeida July 11, 2011 11:26AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 68
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready