2

I m new to nginx my server block is

server {
    listen 25552;
    server_name *.example.com;
    root /usr/share/myPackage;
    rewrite ^/$ /index.php permanent;

        location ~ ((\.php$)|(^/(status)$)) {
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
       }
       access_log  /var/log/nginx/console-access.log;
}

Using browser i m able to get status 200 while hit my url - www.example.com:25552/index.php and same status for other php file but nothing is shown in the page. While i try to change the url and i am able to get my html,js and image file on my browser. What i think is that my php file are not getting parsed pls help me .... :)

Andrew Schulman
  • 8,811
  • 21
  • 32
  • 47
level_0
  • 31
  • 1
  • 4

2 Answers2

1

Make sure PHP-FPM is listening on 127.0.0.1:9000 and not another socket. Without knowing more about the server, I can't tell you specifically where to look.

samh
  • 213
  • 4
  • 11
  • this is my access-log for php file - HTTP/1.1" 200 5 " for html file - HTTP/1.1" 200 640 " for images - HTTP/1.1" 200 663073 " it varies with diffrent images and yes it listening /etc/php5/fpm/pool.d/host-stats.conf:listen = 127.0.0.1:9000 – level_0 May 08 '14 at 08:27
  • If PHP files "weren't being parsed" you would probably get raw PHP code as output. Do you have anything in your nginx error log (you didn't show one in your nginx config there) or PHP error log? – samh May 08 '14 at 16:04
  • their was no nginx error – level_0 May 08 '14 at 16:23
1

I m not passing all fastcgi_params i followed this link help me to figure out my problem

level_0
  • 31
  • 1
  • 4
  • Confirming that this worked for me. After an update where I carefully integrated updated config files, I had blank screen on any PHP file, no error messages or logs, HTTP status 200 OK. I was missing two lines in /etc/nginx/fastcgi_params . I updated using that link and it worked. Thanks! :) – HoboBen May 18 '15 at 16:08