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