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 .... :)

2 Answers 2

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.

3
  • 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 8, 2014 at 8: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 8, 2014 at 16:04
  • their was no nginx error
    – level_0
    May 8, 2014 at 16:23
1

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

1
  • 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, 2015 at 16:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .