Welcome! Log In Create A New Profile

Advanced

Empty page :-/

Posted by Fred 
Fred
Empty page :-/
July 15, 2010 02:36PM
Hello

This is the first time I install Nginx, so this is probably a very
simple problem to solve for experts, but I'm lost at what to try.

As far as I can tell, Nginx works fine, the PHP5-FPM processes are up
and running as well, but when I hit the server...

- with "http://192.168.0.8" : 403/directory index of "/var/www/" is
forbidden

- with "http://192.168.0.8/index.php" : blank page; FWIW, /var/log/
nginx/localhost.access.log says "GET /index.php HTTP/1.1" 404 31"

More information on the setup:
Hardware = x86 server
OS = Ubuntu 10.04
Nginx = 0.7.65-1ubuntu2
PHP5 = php5-cgi 5.3.2-1ubuntu4.2 + php5-cli 5.3.2-1ubuntu4.2 + php5-
common 5.3.2-1ubuntu4.2 + php5-fpm 5.3.2-1ubuntu4.2ppa4~lucid1 + php5-
suhosin 0.9.29-1ubuntu1
PHP5-FPM = php5-fpm 5.3.2-1ubuntu4.2ppa4~lucid1

Everything installed through apt-get from either the default repo or
from "ppa:brianmercer/php".

Any hint appreciated,
Thank you.
Re: Empty page :-/
July 15, 2010 04:42PM
Fred Wrote:
-------------------------------------------------------
> Hello
>
> This is the first time I install Nginx, so this is
> probably a very
> simple problem to solve for experts, but I'm lost
> at what to try.
>
> As far as I can tell, Nginx works fine, the
> PHP5-FPM processes are up
> and running as well, but when I hit the server...
>
> - with "http://192.168.0.8" : 403/directory index
> of "/var/www/" is
> forbidden
>
> - with "http://192.168.0.8/index.php" : blank
> page; FWIW, /var/log/
> nginx/localhost.access.log says "GET /index.php
> HTTP/1.1" 404 31"
>
> More information on the setup:
> Hardware = x86 server
> OS = Ubuntu 10.04
> Nginx = 0.7.65-1ubuntu2
> PHP5 = php5-cgi 5.3.2-1ubuntu4.2 + php5-cli
> 5.3.2-1ubuntu4.2 + php5-
> common 5.3.2-1ubuntu4.2 + php5-fpm
> 5.3.2-1ubuntu4.2ppa4~lucid1 + php5-
> suhosin 0.9.29-1ubuntu1
> PHP5-FPM = php5-fpm 5.3.2-1ubuntu4.2ppa4~lucid1
>
> Everything installed through apt-get from either
> the default repo or
> from "ppa:brianmercer/php".
>
> Any hint appreciated,
> Thank you.

Did you use http://www.howtoforge.com/installing-nginx-with-php-5.3-and-php-fpm-on-ubuntu-lucid-lynx-10.04-without-compiling-anything like Gilles from the thread on the nginx mailing list? http://forum.nginx.org/read.php?2,109131

I went through that tutorial with a fresh system and you should add:

sudo service nginx restart

and

sudo service php5-fpm restart

Neither gets started automatically upon first installation. They are started automatically if you reboot the server.

I'm not sure how good you are with vim but to edit the /etc/nginx/sites-enabled/default file I'd do

sudo nano /etc/nginx/sites-enabled/default

and then ctrl-k to erase all the original lines, copy and paste in his text (putty uses right-click to paste) and then ctrl-o and return to save and ctrl-x to exit.

Then do the same for /var/www/index.php

sudo nano /var/www/index.php

paste in his one line of test code, ctrl-o, return, ctrl-x.

Other than those, it worked for me on a fresh server. I posted my suggestions to his how-to.

P.S. Actually I had to "sudo apt-get install python-software-properties" before "add-apt-repository" would work. I booted up a very minimal system.
Rodrigo Dlugokenski
Re: Empty page :-/
July 27, 2010 12:26PM
I'm trying to use nginx + php-fpm too, but getting same errors.

I'm tried your tutorial, but logs shows nothing. I got only blank
pages.

In the same machine, with apache+php all works beautifully. PHP cli
also works normally.

When I stop php-fpm, nginx returns http 502 bad-gateway as expected,
for any php file.

Oh I'm using PHP 5.3.3, bundled with fpm. My distro is ArchLinux.


/var/log/php-fpm.log shows nothing, only a notice that is running.
Syslog's logs only registered my installation using pacman (apt-get of
archlinux). Nginx logs only shows my http get without errors

192.168.254.1 - - [27/Jul/2010:13:04:27 -0300] "GET /phpinfo.php HTTP/
1.1" 404 5 "http://www/" "Mozilla/5.0 (Windows; U; Windows NT 6.1;
WOW64; en-US; rv:2.0b1) Gecko/20100630 Firefox/4.0b1"

Except when I shut down php-fpm daemon:

2010/07/27 13:10:51 [error] 1307#0: *17 connect() failed (111:
Connection refused) while connecting to upstream, client:
192.168.254.1, server: localhost, request: "GET /phpinfo.php HTTP/
1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www", referrer:
"http://www/"

But this don't occurs when I start php-fpm.

Already tried weird thins like chowning to http user/group and
chmodding 777 on everything. I tried nginx without passenger support,
and with passenger support. With passenger support my rails apps works
fine. Only php don't, no matter what I do.

Do you have any other way to track this?


On Jul 15, 5:42 pm, "brianmercer" <nginx-fo...@nginx.us> wrote:
> Fred Wrote:
> -------------------------------------------------------
>
>
>
>
>
>
>
>
>
> > Hello
>
> > This is the first time I install Nginx, so this is
> > probably a very
> > simple problem to solve for experts, but I'm lost
> > at what to try.
>
> > As far as I can tell, Nginx works fine, the
> > PHP5-FPM processes are up
> > and running as well, but when I hit the server...
>
> > - with "http://192.168.0.8" : 403/directory index
> > of "/var/www/" is
> > forbidden
>
> > - with "http://192.168.0.8/index.php" : blank
> > page; FWIW, /var/log/
> > nginx/localhost.access.log says "GET /index.php
> > HTTP/1.1" 404 31"
>
> > More information on the setup:
> > Hardware = x86 server
> > OS = Ubuntu 10.04
> > Nginx = 0.7.65-1ubuntu2
> > PHP5  = php5-cgi 5.3.2-1ubuntu4.2 + php5-cli
> > 5.3.2-1ubuntu4.2 + php5-
> > common 5.3.2-1ubuntu4.2 + php5-fpm
> > 5.3.2-1ubuntu4.2ppa4~lucid1 + php5-
> > suhosin 0.9.29-1ubuntu1
> > PHP5-FPM = php5-fpm 5.3.2-1ubuntu4.2ppa4~lucid1
>
> > Everything installed through apt-get from either
> > the default repo or
> > from "ppa:brianmercer/php".
>
> > Any hint appreciated,
> > Thank you.
>
> Did you usehttp://www.howtoforge.com/installing-nginx-with-php-5.3-and-php-fpm-o...
> like Gilles from the thread on the nginx mailing list?http://forum.nginx.org/read.php?2,109131
>
> I went through that tutorial with a fresh system and you should add:
>
> sudo service nginx restart
>
> and
>
> sudo service php5-fpm restart
>
> Neither gets started automatically upon first installation.  They are
> started automatically if you reboot the server.
>
> I'm not sure how good you are with vim but to edit the
> /etc/nginx/sites-enabled/default file I'd do
>
> sudo nano /etc/nginx/sites-enabled/default
>
> and then ctrl-k to erase all the original lines, copy and paste in his
> text (putty uses right-click to paste) and then ctrl-o and return to
> save and ctrl-x to exit.
>
> Then do the same for /var/www/index.php
>
> sudo nano /var/www/index.php
>
> paste in his one line of test code, ctrl-o, return, ctrl-x.
>
> Other than those, it worked for me on a fresh server.  I posted my
> suggestions to his how-to.
>
> P.S. Actually I had to "sudo apt-get install python-software-properties"
> before "add-apt-repository" would work.  I booted up a very minimal
> system.
>
> Posted at Nginx Forum:http://forum.nginx.org/read.php?3,109277,109331#msg-109331
Rodrigo Dlugokenski
Re: Empty page :-/
July 27, 2010 02:18PM
I tried another approach, installing php-cgi.

I figured out now, because in my browser php-cgi returned "No input
file specified". Then i figured that something was wrong in my
nginx.conf.

I need to change fastcgi_param SCRIPT_FILENAME /srv/http/nginx/
$fastcgi_script_name; acording to my site root.

Why php-fpm does not return anything like php-cgi? This can be useful,
like php-cgi did.

On Jul 27, 1:19 pm, Rodrigo Dlugokenski <rdd...@gmail.com> wrote:
> I'm trying to use nginx + php-fpm too, but getting same errors.
>
> I'm tried your tutorial, but logs shows nothing. I got only blank
> pages.
>
> In the same machine, with apache+php all works beautifully. PHP cli
> also works normally.
>
> When I stop php-fpm, nginx returns http 502 bad-gateway as expected,
> for any php file.
>
> Oh I'm using PHP 5.3.3, bundled with fpm. My distro is ArchLinux.
>
> /var/log/php-fpm.log shows nothing, only a notice that is running.
> Syslog's logs only registered my installation using pacman (apt-get of
> archlinux). Nginx logs only shows my http get without errors
>
> 192.168.254.1 - - [27/Jul/2010:13:04:27 -0300] "GET /phpinfo.php HTTP/
> 1.1" 404 5 "http://www/" "Mozilla/5.0 (Windows; U; Windows NT 6.1;
> WOW64; en-US; rv:2.0b1) Gecko/20100630 Firefox/4.0b1"
>
> Except when I shut down php-fpm daemon:
>
> 2010/07/27 13:10:51 [error] 1307#0: *17 connect() failed (111:
> Connection refused) while connecting to upstream, client:
> 192.168.254.1, server: localhost, request: "GET /phpinfo.php HTTP/
> 1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www", referrer:
> "http://www/"
>
> But this don't occurs when I start php-fpm.
>
> Already tried weird thins like chowning to http user/group and
> chmodding 777 on everything. I tried nginx without passenger support,
> and with passenger support. With passenger support my rails apps works
> fine. Only php don't, no matter what I do.
>
> Do you have any other way to track this?
>
> On Jul 15, 5:42 pm, "brianmercer" <nginx-fo...@nginx.us> wrote:
>
>
>
>
>
>
>
> > Fred Wrote:
> > -------------------------------------------------------
>
> > > Hello
>
> > > This is the first time I install Nginx, so this is
> > > probably a very
> > > simple problem to solve for experts, but I'm lost
> > > at what to try.
>
> > > As far as I can tell, Nginx works fine, the
> > > PHP5-FPM processes are up
> > > and running as well, but when I hit the server...
>
> > > - with "http://192.168.0.8" : 403/directory index
> > > of "/var/www/" is
> > > forbidden
>
> > > - with "http://192.168.0.8/index.php" : blank
> > > page; FWIW, /var/log/
> > > nginx/localhost.access.log says "GET /index.php
> > > HTTP/1.1" 404 31"
>
> > > More information on the setup:
> > > Hardware = x86 server
> > > OS = Ubuntu 10.04
> > > Nginx = 0.7.65-1ubuntu2
> > > PHP5  = php5-cgi 5.3.2-1ubuntu4.2 + php5-cli
> > > 5.3.2-1ubuntu4.2 + php5-
> > > common 5.3.2-1ubuntu4.2 + php5-fpm
> > > 5.3.2-1ubuntu4.2ppa4~lucid1 + php5-
> > > suhosin 0.9.29-1ubuntu1
> > > PHP5-FPM = php5-fpm 5.3.2-1ubuntu4.2ppa4~lucid1
>
> > > Everything installed through apt-get from either
> > > the default repo or
> > > from "ppa:brianmercer/php".
>
> > > Any hint appreciated,
> > > Thank you.
>
> > Did you usehttp://www.howtoforge.com/installing-nginx-with-php-5.3-and-php-fpm-o...
> > like Gilles from the thread on the nginx mailing list?http://forum.nginx.org/read.php?2,109131
>
> > I went through that tutorial with a fresh system and you should add:
>
> > sudo service nginx restart
>
> > and
>
> > sudo service php5-fpm restart
>
> > Neither gets started automatically upon first installation.  They are
> > started automatically if you reboot the server.
>
> > I'm not sure how good you are with vim but to edit the
> > /etc/nginx/sites-enabled/default file I'd do
>
> > sudo nano /etc/nginx/sites-enabled/default
>
> > and then ctrl-k to erase all the original lines, copy and paste in his
> > text (putty uses right-click to paste) and then ctrl-o and return to
> > save and ctrl-x to exit.
>
> > Then do the same for /var/www/index.php
>
> > sudo nano /var/www/index.php
>
> > paste in his one line of test code, ctrl-o, return, ctrl-x.
>
> > Other than those, it worked for me on a fresh server.  I posted my
> > suggestions to his how-to.
>
> > P.S. Actually I had to "sudo apt-get install python-software-properties"
> > before "add-apt-repository" would work.  I booted up a very minimal
> > system.
>
> > Posted at Nginx Forum:http://forum.nginx.org/read.php?3,109277,109331#msg-109331
Re: Empty page :-/
July 27, 2010 04:18PM
On Tue, Jul 27, 2010 at 10:05 AM, Rodrigo Dlugokenski <rddweb@gmail.com> wrote:
> I tried another approach, installing php-cgi.
>
> I figured out now, because in my browser php-cgi returned "No input
> file specified". Then i figured that something was wrong in my
> nginx.conf.
>
> I need to change fastcgi_param  SCRIPT_FILENAME  /srv/http/nginx/
> $fastcgi_script_name; acording to my site root.
>
> Why php-fpm does not return anything like php-cgi? This can be useful,
> like php-cgi did.

php-fpm -should- behave just like php-cgi.

SCRIPT_FILENAME is the key variable that is required to tell the
interpreter "hey parse this file" - otherwise you get the awesome "No
input file specified" (does it give an HTTP header? would be -great-
if we could trap this in nginx and show a better error page, like a
4xx or 5xx instead)
Re: Empty page :-/
July 27, 2010 05:01PM
Rodrigo Dlugokenski Wrote:
-------------------------------------------------------
> I tried another approach, installing php-cgi.
>
> I figured out now, because in my browser php-cgi
> returned "No input
> file specified". Then i figured that something was
> wrong in my
> nginx.conf.
>
> I need to change fastcgi_param SCRIPT_FILENAME
> /srv/http/nginx/
> $fastcgi_script_name; acording to my site root.
>
> Why php-fpm does not return anything like php-cgi?
> This can be useful,
> like php-cgi did.
>

It's true, the php-cgi output of "No input file specified" was useful. I wouldn't object to some kind of generic 404 message like php-cgi has.

On the other hand, php-fpm does return what it is supposed to return: a 404 Not Found code. What the web server does with that 404 is then up to you.

With nginx, if you have both an "error_page 404 404.html;" directive in your nginx config and "fastcgi_intercept_errors on;" then you'll get your specified error page. If you don't, then nginx does not send its default 404 page, it just sends a white screen with a 404 code.

Oddly, my 404s go to the php backend (i.e. error_page 404 @drupal) and I get an nginx default 404.
Re: Empty page :-/
July 27, 2010 05:25PM
brianmercer Wrote:

> With nginx, if you have both an "error_page 404
> 404.html;" directive in your nginx config and
> "fastcgi_intercept_errors on;" then you'll get
> your specified error page. If you don't, then
> nginx does not send its default 404 page, it just
> sends a white screen with a 404 code.

Make that

error_page 404 =404 /404.txt;

for the correct behavior.
Rodrigo Dlugokenski
Re: Empty page :-/
July 27, 2010 08:06PM
The problem is that with php-cgi and the error I figured out what is wrong,
corrected and worked. Straight to the point. With php-fpm and the lack of
the error message I spent several hours trying to figure.

The 404 error message as sugested don't helps. After I feel secure and put
on production can be useful, but not at initial inistallation, a 404 doesn't
say to me that is that line on the nginx.conf that is wrong. The error page
to the final user is not the point.

fast_cgi_intercept errors are already on. In that several hours I spent i
read all the docs available on php-fpm website, wiki, searched forums, etc.
And tried everything, including fast_cgi_intercept.

The lack of directions to take even made my post at archlinux forums a
instant first place on google - with no replies :((

Now with the inclusion of fpm in php core, fpm will get more attention, like
with me. Don't get me wrong. I only worried about more people getting
similar problems and no directions to take.

Stay in peace and thanks for your reply! ;D
Now my nginx setup completed 6 hours with no error, rock solid like with
apache. I deployed only our developers tools and apps for now, but later,
who knows, all the apps I need to run on my server.


On Tue, Jul 27, 2010 at 5:15 PM, Michael Shadle <mike503@gmail.com> wrote:

> On Tue, Jul 27, 2010 at 10:05 AM, Rodrigo Dlugokenski <rddweb@gmail.com>
> wrote:
> > I tried another approach, installing php-cgi.
> >
> > I figured out now, because in my browser php-cgi returned "No input
> > file specified". Then i figured that something was wrong in my
> > nginx.conf.
> >
> > I need to change fastcgi_param SCRIPT_FILENAME /srv/http/nginx/
> > $fastcgi_script_name; acording to my site root.
> >
> > Why php-fpm does not return anything like php-cgi? This can be useful,
> > like php-cgi did.
>
> php-fpm -should- behave just like php-cgi.
>
> SCRIPT_FILENAME is the key variable that is required to tell the
> interpreter "hey parse this file" - otherwise you get the awesome "No
> input file specified" (does it give an HTTP header? would be -great-
> if we could trap this in nginx and show a better error page, like a
> 4xx or 5xx instead)
>
Sorry, only registered users may post in this forum.

Click here to login

Online Users

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