Welcome! Log In Create A New Profile

Advanced

How to Debug Silent Failure, NGINX+php-fpm ?

Posted by Dan Farrell 
Dan Farrell
How to Debug Silent Failure, NGINX+php-fpm ?
March 07, 2012 08:26PM
Hi,

I've set up nginx + php-fpm for php web scripting. But, all php
scripts load as blank white pages.

I've verified that nginx seems to be passing the scripts off properly
(gives 200 message in log, no error).

However the pages only load as a blank white page. I know the pages
work; switching to an Apache proxy_pass in Nginx makes everything work
normal.

So my question is, how the heck can I find out why? php-fpm seems to
be far too quiet about this. I've tried setting damonize to no and
turning the log level to 'debug', but still don't get any errors at
all.

I've put my full config files online:

http://ebony.farrellit.net/php.ini
http://ebony.farrellit.net/php-fpm.conf
http://ebony.farrellit.net/nginx.conf

And you can see what happens when you load a php page through php-fpm
here:

http://ebony.farrellit.net/index.php

I don't understand how to figure this out. I've checked all the logs,
but nginx seems perfectly fine, and php-fpm is totally silent.
Therefore, I'd greatly appreciate it if anyone had any assistance to
offer.

Thanks much,

-- DF
Re: How to Debug Silent Failure, NGINX+php-fpm ?
March 07, 2012 08:42PM
Dan Farrell Wrote:
-------------------------------------------------------
> Hi,
>
> I've set up nginx + php-fpm for php web scripting.
> But, all php
> scripts load as blank white pages.
>
> I've verified that nginx seems to be passing the
> scripts off properly
> (gives 200 message in log, no error).
>
> However the pages only load as a blank white page.
> I know the pages
> work; switching to an Apache proxy_pass in Nginx
> makes everything work
> normal.
>
> So my question is, how the heck can I find out
> why? php-fpm seems to
> be far too quiet about this. I've tried setting
> damonize to no and
> turning the log level to 'debug', but still don't
> get any errors at
> all.
>
> I've put my full config files online:
>
> http://ebony.farrellit.net/php.ini
> http://ebony.farrellit.net/php-fpm.conf
> http://ebony.farrellit.net/nginx.conf
>
> And you can see what happens when you load a php
> page through php-fpm
> here:
>
> http://ebony.farrellit.net/index.php
>
> I don't understand how to figure this out. I've
> checked all the logs,
> but nginx seems perfectly fine, and php-fpm is
> totally silent.
> Therefore, I'd greatly appreciate it if anyone had
> any assistance to
> offer.
>
> Thanks much,
>
> -- DF

What about a testme.php file in root with <?php phpinfo() ?> in it?

That nginx.conf looks like it has some uncommented junk near the bottom in the SSL section. That might just be an artifact of the copy and paste, but maybe delete that stuff.

--
Brian
Re: How to Debug Silent Failure, NGINX+php-fpm ?
March 08, 2012 03:24AM
On 3/7/2012 8:14 PM, Dan Farrell wrote:
> Hi,
>
> I've set up nginx + php-fpm for php web scripting. But, all php
> scripts load as blank white pages.
>
> I've verified that nginx seems to be passing the scripts off properly
> (gives 200 message in log, no error).
>
> However the pages only load as a blank white page. I know the pages
> work; switching to an Apache proxy_pass in Nginx makes everything work
> normal.
>
> So my question is, how the heck can I find out why? php-fpm seems to
> be far too quiet about this. I've tried setting damonize to no and
> turning the log level to 'debug', but still don't get any errors at
> all.
>
> I've put my full config files online:
>
> http://ebony.farrellit.net/php.ini
> http://ebony.farrellit.net/php-fpm.conf
> http://ebony.farrellit.net/nginx.conf
>
> And you can see what happens when you load a php page through php-fpm
> here:
>
> http://ebony.farrellit.net/index.php
>
> I don't understand how to figure this out. I've checked all the logs,
> but nginx seems perfectly fine, and php-fpm is totally silent.
> Therefore, I'd greatly appreciate it if anyone had any assistance to
> offer.
>
> Thanks much,
>
> -- DF

Try

include /etc/nginx/fastcgi_params;

in that php section.


--
Brian
Dan Farrell
Re: How to Debug Silent Failure, NGINX+php-fpm ?
March 08, 2012 10:20AM
Hurrah! It works! Every example I saw included that line; I wonder
in retrospect why I deemed it unimportant?

Thank you very much, sir!

On Mar 7, 8:46 pm, Brian Mercer <m...@brianmercer.com> wrote:
> On 3/7/2012 8:14 PM, Dan Farrell wrote:
>
>
>
>
>
>
>
>
>
> > Hi,
>
> > I've set up nginx + php-fpm for php web scripting.  But, all php
> > scripts load as blank white pages.
>
> > I've verified that nginx seems to be passing the scripts off properly
> > (gives 200 message in log, no error).
>
> > However the pages only load as a blank white page.  I know the pages
> > work; switching to an Apache proxy_pass in Nginx makes everything work
> > normal.
>
> > So my question is, how the heck can I find out why?  php-fpm seems to
> > be far too quiet about this.   I've tried setting damonize to no and
> > turning the log level to 'debug', but still don't get any errors at
> > all.
>
> > I've put my full config files online:
>
> >http://ebony.farrellit.net/php.ini
> >http://ebony.farrellit.net/php-fpm.conf
> >http://ebony.farrellit.net/nginx.conf
>
> > And you can see what happens when you load a php page through php-fpm
> > here:
>
> >http://ebony.farrellit.net/index.php
>
> > I don't understand how to figure this out.  I've checked all the logs,
> > but nginx seems perfectly fine, and php-fpm is totally silent.
> > Therefore, I'd greatly appreciate it if anyone had any assistance to
> > offer.
>
> > Thanks much,
>
> > -- DF
>
> Try
>
> include /etc/nginx/fastcgi_params;
>
> in that php section.
>
> --
> Brian
Re: How to Debug Silent Failure, NGINX+php-fpm ?
October 23, 2012 07:12AM
I have the same problem. I already include fastcgi_params in my configs. Here's my nginx conf file. Can someone help?


#new
#user nobody;
worker_processes 5;

#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;

events {
worker_connections 1024;
}

http {
include mime.types;
default_type application/octet-stream;

#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';

#access_log logs/access.log main;

ignore_invalid_headers on;
sendfile on;
#tcp_nopush on;

keepalive_timeout 65;

gzip off;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 30;
proxy_send_timeout 30;
proxy_read_timeout 30;
proxy_buffers 64 4k;

#ssl_certificate server.crt;
#ssl_certificate_key server.key;

server {
listen 8081;
#listen 443 default ssl;

server_name localhost;

charset utf-8;
#access_log logs/host.access.log main;

location / {
root html;
}

location MDClientForSolace {
root html;
}

location ^~ /MDClientForSolace/smf/ {
proxy_pass http://69.20.234.126:8134;
}

#error_page 404 /404.html;

# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}

location ~ \.php {
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_intercept_errors on;
fastcgi_index index.php;
include fastcgi_params;
}

}
}
Re: How to Debug Silent Failure, NGINX+php-fpm ?
May 03, 2014 11:52AM
hi,
Can I print the log in the front to debug?
I am newbie.
thanks
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 137
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready