2 responses

  1. GZ
    May 3, 2013

    can’t do it when it comes to the php testing part, it shows the source code rather than the phpinfo in my browser.

    • ViruSzZ
      May 7, 2013

      exactly. this is because there is no PHP block within nginx’s server block.

      try adding something like this:

      ## php block
      location ~ .php?$ {
      try_files $uri =404;
      include fastcgi_params;
      #fastcgi_pass unix:/var/run/php-fpm.sock;
      fastcgi_pass 127.0.0.1:9000;
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
      fastcgi_intercept_errors on;
      fastcgi_split_path_info ^(.+.php)(.*)$;
      #Prevent version info leakage
      fastcgi_hide_header X-Powered-By;
      }

      and it will work.

      also you may want to check my article on this at https://d.stavrovski.net/blog/install-and-configure-nginx-mysql-php-fpm-in-centos-6/#set-up-nginx

Leave a Reply

 

 

 

Back to top
mobile desktop