Welcome! Log In Create A New Profile

Advanced

Re: 502 Bad Gateway once running php on command line

Lucas Rolff
March 23, 2016 05:28AM
When issuing php directly from the command-line, you don't even go
through nginx.
php from the command-line relies on the php-cli which isn't talking to
your nginx process nor php-fpm.

> marcusy3k <mailto:nginx-forum@forum.nginx.org>
> 23 March 2016 at 10:05
> Eventually I find what went wrong, it should be caused by both Zend
> OPcache
> and XCache are installed, they may conflict each other in this case, once
> I've removed the XCache, it works fine, the php command line would no
> longer
> cause the php-fpm error.
>
> XCache should be unnecessary when OPcache is running.
>
> Posted at Nginx Forum:
> https://forum.nginx.org/read.php?2,265576,265584#msg-265584
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
> marcusy3k <mailto:nginx-forum@forum.nginx.org>
> 23 March 2016 at 05:59
> I have just installed:
> - FreeBSD 10.2
> - Nginx 1.8.1
> - PHP 5.5.33
>
> Nginx works fine with PHP that the web sites seems ok to run php pages.
> However, once I run php on command line (e.g. php -v), the web site
> will get
> "502 Bad Gateway" error, and I find the nginx error log as below:
>
> [error] 714#0: *3 upstream prematurely closed connection while reading
> response header from
> upstream, client: _____, server: www.____.com, request: "GET / HTTP/1.1",
> upstream: "fastcgi://unix:/
> var/run/php5-fpm.sock:", host: "_____"
>
> I have tried to use either sock or port, but the problem still
> exist... any
> idea about what's wrong? thanks.
>
> "php -v" shows below:
> PHP 5.5.33 (cli) (built: Mar 15 2016 01:22:17)
> Copyright (c) 1997-2015 The PHP Group
> Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
> with XCache v3.2.0, Copyright (c) 2005-2014, by mOo
> with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend
> Technologies
> with XCache Cacher v3.2.0, Copyright (c) 2005-2014, by mOo
>
> Posted at Nginx Forum:
> https://forum.nginx.org/read.php?2,265576,265576#msg-265576
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx

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

502 Bad Gateway once running php on command line

marcusy3k March 23, 2016 12:59AM

Re: 502 Bad Gateway once running php on command line

Lucas Rolff March 23, 2016 02:32AM

Re: 502 Bad Gateway once running php on command line

marcusy3k March 23, 2016 02:35AM

Re: 502 Bad Gateway once running php on command line

marcusy3k March 23, 2016 05:05AM

Re: 502 Bad Gateway once running php on command line

Lucas Rolff March 23, 2016 05:28AM

Re: 502 Bad Gateway once running php on command line

marcusy3k March 23, 2016 06:07AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 110
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