Nginx, using socket
March 22, 2011 01:36PM
Hi
I want to use a socket instead of tcp (for using fastcgi), as described in this article (http://wiki.nginx.org/PHPFcgiExample)
I do as written, but it's won't work :( Message "502 Bad Gateway". Please, help
nginx.conf:
location ~ \.php$ {
root /srv/www;
#fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/tmp/php.socket;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /srv/www$fastcgi_script_name;
include fastcgi_params;
---
php-fastcgi:
BIND=/tmp/php.socket
Re: Nginx, using socket
March 23, 2011 09:06AM
2011/03/23 14:49:20 [error] 1201#0: *1 connect() to unix:/tmp/php.socket failed (111: Connection refused) while connecting to upstream, client: 192.168.137.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/tmp/php.socket:", host: "192.168.137.3"



Edited 1 time(s). Last edit at 03/23/2011 09:06AM by Outsider.
Re: Nginx, using socket
March 23, 2011 12:29PM
issue has been resolved, it was necessary to add arguments to the script run PHP :)
Re: Nginx, using socket
March 23, 2011 03:02PM
I have the same issue but do not get your solution. Could you provide some more details what you did to PHP?
Re: Nginx, using socket
April 15, 2011 08:31AM
gwen0815 Wrote:
-------------------------------------------------------
> I have the same issue but do not get your
> solution. Could you provide some more details what
> you did to PHP?


Try running the php cgi with:

`php5-cgi -b /path/to/your/socket.sock`
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 184
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready