# Problem witch fastcgi conettions

**URL:** <https://www.ruby-forum.com/t/problem-witch-fastcgi-conettions/186183>\
**Category:** NGINX\
**Created:** [April 1, 2010, 7:07pm UTC](https://www.ruby-forum.com/t/problem-witch-fastcgi-conettions/186183 "2010-04-01T19:07:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michel\_Vega\_Fuenzal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c77e96/32.png) [@Michel\_Vega\_Fuenzal](https://www.ruby-forum.com/u/Michel_Vega_Fuenzal)\
**Post date:** [April 1, 2010, 7:07pm UTC](https://www.ruby-forum.com/t/problem-witch-fastcgi-conettions/186183/1 "2010-04-01T19:07:08Z")

</div>

Hi list, sorry my english.

I use this tutorial:

[http://blog.codefront.net/2007/06/11/nginx-php-and-a-php-fastcgi-daemon-init-script/](http://blog.codefront.net/2007/06/11/nginx-php-and-a-php-fastcgi-daemon-init-script/)

and the 9000 port is open:

root@adminred:/etc/init.d# nmap localhost

Starting Nmap 4.76 ( [http://nmap.org](http://nmap.org) ) at 2010-04-01 12:44 CDT  
Warning: Hostname localhost resolves to 2 IPs. Using 127.0.0.1.  
Interesting ports on localhost.localdomain (127.0.0.1):  
Not shown: 995 closed ports  
PORT STATE SERVICE  
22/tcp open ssh  
80/tcp open http  
631/tcp open ipp  
9000/tcp open unknown

in /etc/nginx/site-enable/defalut, I have that:

server {  
listen 80;  
server\_name localhost;

```
    access_log /var/log/nginx/localhost.access.log;

    location / {
            root /var/www/nginx-default;
            index index.html index.htm;
    }

    location /doc {
            root /usr/share;
            autoindex on;
            allow 127.0.0.1;
            deny all;
    }

    location /images {
            root /usr/share;
            autoindex on;
    }

    # La Web de la SCJM
    location /SCJM {
            root /home/michelvf;
            index index.php;
    }

    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
            root /var/www/nginx-default;
    }

```

location ~ .php$ {  
fastcgi\_pass 127.0.0.1:9000;  
fastcgi\_index index.php;  
fastcgi\_param SCRIPT\_FILENAME  
/scripts$fastcgi\_script\_name;  
include fastcgi\_params;  
}

}

And in the browser, show that:  
No input file specified.

And the log show that:  
2010/04/01 12:21:19 [error] 6196#0: \*1 connect() failed (111: Connection  
refused) while connecting to upstream, client: 127.0.0.1, server:  
localhost, request: “GET /scjm/index.php HTTP/1.1”, upstream:  
“fastcgi://127.0.0.1:9000”, host: “localhost”  
2010/04/01 12:24:00 [error] 6196#0: \*6 connect() failed (111: Connection  
refused) while connecting to upstream, client: 127.0.0.1, server:  
localhost, request: “GET /scjm/index.php HTTP/1.1”, upstream:  
“fastcgi://127.0.0.1:9000”, host: “localhost”

Why the browser don’t can show de index.php.

Thank to all.

–  
Usemos el Software Libre “Con todos y para el bien de todos”  
José Martí, 26 de noviembre de 1891, Tampa.

Lic. Michel Vega Fuenzalida. Usuario Linux: 353763  
Coordinador del Grupo Linux Pinero  
Administrador de Red  
Hospital General Docente “Héroes de Baire”,  
Nueva Gerona, Isla de la Juventud, Cuba.

Teléfono: +53 46 323012.

–

Este mensaje le ha llegado mediante el servicio de correo electronico  
que ofrece Infomed para respaldar el cumplimiento de las misiones del  
Sistema Nacional de Salud. La persona que envia este correo asume el  
compromiso de usar el servicio a tales fines y cumplir con las  
regulaciones establecidas

Infomed: [http://www.sld.cu/](http://www.sld.cu/)

---

<div class="post-metadata">

**Author:** ![Michel\_Vega\_Fuenzal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c77e96/32.png) [@Michel\_Vega\_Fuenzal](https://www.ruby-forum.com/u/Michel_Vega_Fuenzal)\
**Post date:** [April 1, 2010, 11:41pm UTC](https://www.ruby-forum.com/t/problem-witch-fastcgi-conettions/186183/2 "2010-04-01T23:41:05Z")

</div>

On Thu, 2010-04-01 at 12:55 -0400, Michel Vega Fuenzalida wrote:

> in /etc/nginx/site-enable/defalut, I have that:  
> }  
> autoindex on;  
> location = /50x.html {  
> root /var/www/nginx-default;  
> }
> 
> location ~ .php$ {  
> fastcgi\_pass 127.0.0.1:9000;  
> fastcgi\_index index.php;  
> fastcgi\_param SCRIPT\_FILENAME  
> /scripts$fastcgi\_script\_name;

I expect that this line (SCRIPT\_FILENAME) is the source of your  
problems. Verify that your URI resolves to this path.

Your URI is /scjm/index.php, and your root is /home/michelvf, so I’m  
_guessing_ your index.php lies at /home/michelvf/scjm/index.php or maybe  
at /home/michelvf/scjm/scripts/index.php? In either case, your  
SCRIPT\_FILENAME is most likely incorrect. SCRIPT\_FILENAME is a  
filesystem path, not a URI, so something like $document\_root  
$fastcgi\_script\_name or $document\_root/scripts/$fastcgi\_script\_name  
would be seem more appropriate.

> ```
> include fastcgi_params;
> }
> 
> ```
> 
> }
> 
> And in the browser, show that:  
> No input file specified.

“No input file specified” is a PHP message. Nginx is successfully  
connecting to PHP, so the error log below is unrelated (probably left  
over from earlier errors that you already corrected).

> And the log show that:  
> 2010/04/01 12:21:19 [error] 6196#0: \*1 connect() failed (111: Connection  
> refused) while connecting to upstream, client: 127.0.0.1, server:  
> localhost, request: “GET /scjm/index.php HTTP/1.1”, upstream:  
> “fastcgi://127.0.0.1:9000”, host: “localhost”  
> 2010/04/01 12:24:00 [error] 6196#0: \*6 connect() failed (111: Connection  
> refused) while connecting to upstream, client: 127.0.0.1, server:  
> localhost, request: “GET /scjm/index.php HTTP/1.1”, upstream:  
> “fastcgi://127.0.0.1:9000”, host: “localhost”

Regards,  
Cliff
