I have upgraded with success my ubuntu server from php7.0 to php7.2
I am using Nginx with php-fpm. Although php -v output is:
PHP 7.2.11-4+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Nov 4 2018 05:10:57) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v10.2.5, Copyright (c) 2002-2018, by ionCube Ltd.
with Zend OPcache v7.2.11-4+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
I noticed that Nginx still runs with php-fpm7.0.
I checked and both php-fpm 7.0 & 7.2 are running.
My /etc/nginx/conf.d/mysite.com.conf doesn't include
location ~* .php$
line.
Output of
find / ( -iname "php.ini" -o -name "www.conf" )
is
/etc/php/7.0/apache2/php.ini
/etc/php/7.0/fpm/pool.d/www.conf
/etc/php/7.0/fpm/php.ini
/etc/php/7.0/cli/php.ini
/etc/php/7.2/fpm/pool.d/www.conf
/etc/php/7.2/fpm/php.ini
/etc/php/7.2/cli/php.ini
Also I don't have any /etc/nginx/conf.d/mysite.com.conf file
I only have global_locations_ssl.conf.inc inside /etc/nginx/conf.d/
Output of
ps -aux | grep nginx
is
root 3123 0.0 0.0 37944 4192 ? Ss Nov05 0:00 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
www-data 3124 0.0 0.0 37944 8416 ? S Nov05 0:54 nginx: worker process
www-data 3125 0.0 0.0 37944 8500 ? S Nov05 0:58 nginx: worker process
www-data 3126 0.0 0.0 37944 8552 ? S Nov05 2:04 nginx: worker process
www-data 3127 0.0 0.0 37944 8588 ? S Nov05 1:04 nginx: worker process
www-data 3128 0.0 0.0 37944 8668 ? S Nov05 1:10 nginx: worker process
www-data 3129 0.0 0.0 37944 8536 ? S Nov05 1:27 nginx: worker process
root 22931 0.0 0.0 13348 916 pts/0 R+ 12:50 0:00 grep --color=auto nginx
So my Nginx master process runs as root.
What should I check to fix this?
you can find solution full solution in https://linode.com/docs/web-servers/nginx/serve-php-php-fpm-and-nginx/
Depending on your distribution and PHP version, the PHP configuration files will be stored in different locations. This guide is using PHP 7.0 from Ubuntu’s repositories on Ubuntu 16.04 as an example, and the
`/etc/php/7.0/fpm/pool.d/www.conf and /etc/php/7.0/fpm/php.ini`
files are what we’ll be modifying.
Find those full file paths using a find command:
`find / \( -iname "php.ini" -o -name "www.conf" \)`
The output should look similar to:
`root#localhost:~# find / \( -iname "php.ini" -o -name "www.conf" \)
/etc/php/7.0/fpm/php.ini
/etc/php/7.0/fpm/pool.d/www.conf
/etc/php/7.0/cli/php.ini
`
The listen.owner and listen.group variables are set to www-data by default, but they need to match the user and group NGINX is running as. If you installed NGINX using our Getting Started with NGINX series, then your setup will be using the nginx user and group. You can verify with:
`ps -aux | grep nginx`
The output should be similar to:
`
root#localhost:~# ps -aux | grep nginx
root 3448 0.0 0.0 32500 3516 ? Ss 18:21 0:00 nginx: master process / usr/sbin/nginx -c /etc/nginx/nginx.conf
nginx 3603 0.0 0.0 32912 2560 ? S 18:24 0:00 nginx: worker process
nginx 3604 0.0 0.0 32912 3212 ? S 18:24 0:00 nginx: worker process
`
This shows the NGINX master process is running as root, and the worker processes are running as the nginx user and group. Change the listen variables to that:
`
sed -i 's/listen.owner = www-data/listen.owner = nginx/g' /etc/php/7.0/fpm/pool.d/www.conf
sed -i 's/listen.group = www-data/listen.group = nginx/g' /etc/php/7.0/fpm/pool.d/www.conf
`
When pairing NGINX with PHP-FPM, it’s possible to return to NGINX a .php URI that does not actually exist in the site’s directory structure. The PHP processor will process the URI, and execute the .php file, because its job is to process anything handed to it by NGINX. This of course presents a security problem.
It’s important limit what NGINX passes to PHP-FPM so malicious scripts can’t be injected into return streams to the server. Instead, the request is stopped, possibly then resulting in a 404. There are multiple ways to do this (see the NGINX wiki) but here we chose to specify the setting in PHP-FPM rather than in NGINX’s configuration.
`sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g' /etc/php/7.0/fpm/php.ini`
You’ll notice that ;cgi.fix_pathinfo=1 is commented out by default. Setting it to 0 and uncommenting it will enforce the configuration should there be any upstream changes in the default value in the future.
Restart PHP-FPM to apply the changes:
`systemctl restart php7.0-fpm.service`
Configure the NGINX Server BlockPermalink
Again pulling from Part 1 of our NGINX series, we’ll start with a basic Server Block for a static HTTP page being served from /var/www/example.com. Replace example.com with your site’s domain or IP address, and the root directive with your site’s root directory.
`/etc/nginx/conf.d/example.com.conf
`server {
listen 80 default_server;
listen [::]:80 default_server;
server_name example.com www.example.com;
root /var/www/example.com;
index index.html;
}
`
To the Server Block above, add a location block containing the PHP directives. You should then have:
/etc/nginx/conf.d/example.com.conf
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name example.com www.example.com;
root /var/www/example.com;
index index.html;
location ~* \.php$ {
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
}
}
This is just a bare minimum to get PHP-FPM working and you will want to configure it further for your specific needs. Some further points about the configuration above:
The location ~* \.php$ means that NGINX will apply this configuration to all .php files (file names are not case sensitive) in your site’s root directory, including any subdirectories containing PHP files.
The * in the ~* \.php$ location directive indicates that PHP file names are not case sensitive. This can be removed if you prefer to enforce letter case.
The fastcgi_pass location must match the listen = value in /etc/php/7.0/fpm/pool.d/www.conf. It is preferable for performance reasons for PHP-FPM to listen on a UNIX socket instead of a TCP address. Only change this if you require PHP-FPM use network connections.
Using $document_root in the SCRIPT_FILENAME parameter instead of an absolute path is preferred by NGINX’s documentation.
Here’s a variation of the location block above. This includes an if statement which disallows the FPM to process files in the /uploads/ directory. This is a security measure which prevents people from being able to upload .php files to your server or application which the FastCGI process manager would then execute.
This only applicable if you allow users to upload or submit files to your site. Change the name of the directory from uploads to whatever suits your need.
/etc/nginx/conf.d/example.com.conf
location ~* \.php$ {
if ($uri !~ "^/uploads/") {
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
}
Reload NGINX:
nginx -s reload
I found the solution.
In my /etc/nginx/sites-enabled/my-site.conf had a line
upstream fastcgi_backend {
server 127.0.0.1:9000;
}
Nginx was configure without the
location ~* .php$
line.
So you don't have to change configuration every time you change php versions.
My problem was that I didn't checked that php-fpm7.0 was running at socket 9000.
The solution was to change in php.ini inside php-fpm7.2 to run at socket 9000
Related
I have pointed my domain rohanpatra.ga to my server and installed nginx. I am currently running two domains on the server, rohanpatra.ga, and meetsecured.tk. MeetSecured is a blockchain video conferencing platform based on Jitsi Meet, and it seems to be running fine. But, when I go to rohanpatra.ga, it just goes to the default nginx page.
I've created the config file:
sites-available directory
config file content
server {
listen 80;
listen [::]:80;
root /var/www/rohanpatra.ga;
index index.php index.html index.htm;
server_name your_domain;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
}
}
And symlinked the file to the sites-enabled folder:
sites-enabled directory
Here is the root directory of the site and the content of the one file index.php:
/var/www/rohanpatra.ga directory
index.php
<?php
phpinfo();
?>
as requested:
root#debian-8gb-hel1-1:~# ps auxww |grep nginx
reponse
root 5874 0.0 0.1 70944 9032 ? Ss May30 0:00 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
www-data 9129 0.0 0.1 71228 9516 ? S 21:52 0:00 nginx: worker process
www-data 9130 0.0 0.0 71228 6344 ? S 21:52 0:00 nginx: worker process
www-data 9131 0.0 0.0 71228 6344 ? S 21:52 0:00 nginx: worker process
www-data 9132 0.0 0.0 71228 6344 ? S 21:52 0:00 nginx: worker process
root 10356 0.0 0.0 6144 888 pts/0 S+ 22:29 0:00 grep nginx
According to Nginx documentation you have misconfigured server_name parameter in your config.
Correct config should look like:
server {
listen 80;
server_name rohanpatra.ga;
root /var/www/rohanpatra.ga;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
}
}
And be sure that this FQDN rohanpatra.ga is correctly resolving on the server itself.
You can check by typing: nslookup rohanpatra.ga at server console.
I want to run php under nginx, I have some difficulties. I'm almost done, however, I have an error 502, I don't know why.
I have Nginx 1.18, php 7.4.x with fpm. I created a php file in: /usr/share/nginx/html/info.php, however when I am on it, I have an error 502. Here is the file I have for the default conf:
server {
listen 80;
root /usr/share/nginx/html;
index index.php index.html index.htm index.nginx-debian.html;
server_name localhost;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
I have seen this line in some cases, however when I do "nginx -t" it fails.
include snippets / fastcgi-php.conf;
I looked carefully, everything works locally, everything works. I do not understand.
In your post above you have server_name example.com. Check if you have the right server name there. Also, make sure your application server is running because nginx is unable to reach that's why you are seeing 502
The problem is having more than 1 config file in /etc/php/7.4/fpm/pool.d
usr#server:/etc/php/7.4/fpm/pool.d$ ls
www.conf foor-php-fpm.conf bar-php-fpm.conf.bak
Solution
Step 1: Remove or rename any other .conf files and leave only www.conf
usr#server:/etc/php/7.4/fpm/pool.d$ sudo mv other-php-fpm.conf other-php-fpm.conf.bak2
Step 2: systemctl restart php7.4-fpm.service
Done!
user#server:~$ systemctl status php7.4-fpm.service
● php7.4-fpm.service - The PHP 7.4 FastCGI Process Manager
Loaded: loaded (/lib/systemd/system/php7.4-fpm.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2020-12-31 16:16:22 UTC; 6s ago
Docs: man:php-fpm7.4(8)
Process: 381508 ExecStartPost=/usr/lib/php/php-fpm-socket-helper install /run/php/php-fpm.sock /etc/php/7.4/fpm/pool.d/www.conf 74 (code=exited, status=0/SUCCESS)
Main PID: 381487 (php-fpm7.4)
Status: "Ready to handle connections"
Tasks: 3 (limit: 4568)
Memory: 12.1M
CGroup: /system.slice/php7.4-fpm.service
├─381487 php-fpm: master process (/etc/php/7.4/fpm/php-fpm.conf)
├─381506 php-fpm: pool www
└─381507 php-fpm: pool www
This solution applies to php-fpm-7.2 as well.
I have a new fresh CentOS7 installed and running as a VM. I am playing with Nginx since I have being using Apache my whole life and now just for fun and learn I decide to switch to Nginx. I am following this two guides:
How to install LEMP on CentOS7 by Digital Ocean
How to install LEMP on CentOS7 by a blog named IfNotTrueThenFalse
And as part of my previous research before I get out of ideas I did read this which is not helpful at all.
Before continue I should said that I took what I need for each of them because I want to use PHP 7.0.x instead of the default that comes with CentOS 7 repos (5.4 I think).
So, this is how my config files looks like:
/etc/nginx/conf.d/default.conf
server {
listen 80;
server_name centos7.localdomain;
root /var/www/html;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ =404;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php$ {
try_files $uri =404
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
/etc/php-fpm.d/www.conf
[www]
; RPM: apache Choosed to be able to access some dir as httpd
user = nginx
; RPM: Keep a group allowed to write in log dir.
group = nginx
...
; Set permissions for unix socket, if one is used. In Linux, read/write
; permissions must be set in order to allow connections from a web server.
; Default Values: user and group are set as the running user
; mode is set to 0660
listen.owner = nobody
listen.group = nobody
For www.conf other than those values you see in here are the default ones. The full file is shared here
I have created the file /var/www/html/index.php with nothing else than:
<?php
phpinfo();
As soon as I try the URL http://centos7.localdomain/index.php (or without the index.php) the file is downloaded instead of display it content.
Of course after all those changes I have restarted nginx and php-fpm services and check them by runing systemctl status nginx.service and systemctl status php-fpm.service
The permissions for /var/www/html are as follow:
$ ls -la /var/www/html/
total 4
drwxr-xr-x. 2 root root 22 Oct 9 20:53 .
drwxr-xr-x. 3 root root 17 Oct 9 20:24 ..
-rw-r--r--. 1 root root 18 Oct 9 20:53 index.php
This is the PHP version I am running:
$ php -v
PHP 7.0.11 (cli) (built: Sep 14 2016 08:28:52) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.11, Copyright (c) 1999-2016, by Zend Technologies
with Xdebug v2.4.1, Copyright (c) 2002-2016, by Derick Rethans
I am missing something here? If so what is it? Or what is wrong on this setup that I am playing with?
Remove "try_files $uri =404" from the last segment. This may solve your problem.
location ~ \.php$ {
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
I am installing a Nginx with PHP7 server on CentOS and like a lot of users I have the 502 bad gateway issue. I read all night long pages trying to solve my issue but I still have the same issue. I will explain it here so if somebody have some idea of what is going on, I would appreciate some help :-)
First of all the error logs from nginx and php-fpm. I use the "socket method" and I tried with the "network method" using 127.0.0.1:9000 but it didn't change anything... So I rollbacked the configuration. According to the logs, it does not seem to be an permission denied issue.
Note: The html pages are OK, the issue only appears with php pages.
nginx.log
2016/04/18 22:59:22 [error] 4705#0: *47 upstream sent invalid status "20 Site temporarily unavailable" while reading response header from upstream, client: 86.253.24.233, server: testvps.balusson.net, request: "GET /phpMyAdmin/ HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/www.sock:", host: "testvps.balusson.net"
2016/04/18 23:46:09 [error] 6115#0: *95 upstream sent invalid status "20 Site temporairement indisponible" while reading response header from upstream, client: 86.253.24.233, server: testvps.balusson.net, request: "GET /index.php HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/www.sock:", host: "testvps.balusson.net"
But I don't see anything in the PHP-FPM logs
[root#vps263501 ~]# tail /var/log/php-fpm/error.log
[18-Apr-2016 21:46:48] NOTICE: fpm is running, pid 8008
[18-Apr-2016 21:46:48] NOTICE: ready to handle connections
[18-Apr-2016 21:59:41] NOTICE: Terminating ...
[18-Apr-2016 21:59:41] NOTICE: exiting, bye-bye!
[18-Apr-2016 22:11:12] NOTICE: fpm is running, pid 2886
[18-Apr-2016 22:11:12] NOTICE: ready to handle connections
[18-Apr-2016 22:11:15] NOTICE: Terminating ...
[18-Apr-2016 22:11:15] NOTICE: exiting, bye-bye!
[18-Apr-2016 22:11:15] NOTICE: fpm is running, pid 2913
[18-Apr-2016 22:11:15] NOTICE: ready to handle connections
My configuration file is quite simple:
/etc/nginx/sites-available/maisonrt2012.conf
server {
listen 80;
server_name testvps.balusson.net;
root /var/www/maisonrt2012/public_html;
index index.html index.htm index.php;
# Pass PHP scripts on to PHP-FPM
location ~* \.php$ {
try_files $uri /index.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_index index.php;
fastcgi_pass unix:/run/php-fpm/www.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
}
location /phpMyAdmin {
root /usr/share/;
index index.html index.htm index.php;
}
}
The default.conf is set to the unix socket according to my sites-available configuration file
server {
listen 80;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm index.php;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php$ {
root /var/www/maisonrt2012/public_html/;
fastcgi_pass unix:/run/php-fpm/www.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
include fastcgi_params;
}
}
In the nginx.conf file, the user is specified as nginx;
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
My PHP-FPM config file is as below
/etc/php-fpm.d/www.conf
; Start a new pool named 'www'.
[www]
user = nginx
group = nginx
;listen = 127.0.0.1:9000
listen = /run/php-fpm/www.sock
listen.owner = nginx
listen.group = nginx
listen.mode = 0660
;listen.acl_users = nobody
;listen.acl_groups =
listen.allowed_clients = 127.0.0.1
The location of www.sock is OK with the nginx user and rights
[root#vps263501 ~]# ls -l /run/php-fpm/
total 0
srw-rw---- 1 nginx nginx 0 Apr 18 22:11 www.sock
I added the two following lines in the file /etc/nginx/fastcgi_params because they were missing (I found this on a different topic)
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
But I still have my issue.
I'm stuck now so if anybody have an idea I would appreciate :-)
Of course, PHP and Nginx are well started with the proper user
[root#vps263501 ~]# ps aux | grep php
root 2913 0.0 0.3 317080 6464 ? Ss Apr18 0:00 php-fpm: master process (/etc/php-fpm.conf)
nginx 2914 0.0 0.4 319436 8460 ? S Apr18 0:00 php-fpm: pool www
nginx 2915 0.0 0.4 319436 8460 ? S Apr18 0:00 php-fpm: pool www
nginx 2916 0.0 0.4 319436 8460 ? S Apr18 0:00 php-fpm: pool www
nginx 2917 0.0 0.4 319436 8460 ? S Apr18 0:00 php-fpm: pool www
nginx 2918 0.0 0.4 319436 8460 ? S Apr18 0:00 php-fpm: pool www
nginx 3705 0.0 0.4 319436 8460 ? S Apr18 0:00 php-fpm: pool www
root 9259 0.0 0.0 103304 892 pts/0 S+ 00:09 0:00 grep php
[root#vps263501 ~]# ps aux | grep nginx
nginx 2914 0.0 0.4 319436 8460 ? S Apr18 0:00 php-fpm: pool www
nginx 2915 0.0 0.4 319436 8460 ? S Apr18 0:00 php-fpm: pool www
nginx 2916 0.0 0.4 319436 8460 ? S Apr18 0:00 php-fpm: pool www
nginx 2917 0.0 0.4 319436 8460 ? S Apr18 0:00 php-fpm: pool www
nginx 2918 0.0 0.4 319436 8460 ? S Apr18 0:00 php-fpm: pool www
nginx 3705 0.0 0.4 319436 8460 ? S Apr18 0:00 php-fpm: pool www
root 4168 0.0 0.1 45556 2140 ? Ss Apr18 0:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
nginx 6115 0.0 0.1 45560 2324 ? S Apr18 0:00 nginx: worker process
root 9261 0.0 0.0 103304 892 pts/0 S+ 00:09 0:00 grep nginx
It might be trivial but I have to admit that I'm confused...
Thanks for your help !
Change socket to 127.0.0.1:9000 in php-fpm and the restart php-fpm.
Then try the following settings in your nginx website conf:
location / {
root /var/www/maisonrt2012/public_html;
index index.php index.html index.htm;
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
#error_page 404 404.html;
}
restart nginx and try it out. Don't forget: www-data may need read and execute Permission to your php files.
Had the same issue. I tried it with brute forcing :P.
Maybe this helps you out.
In case anyone else browsing StackOverflow hits this issue again, I can see that this sort of thing is mentioned in many places, e.g.
https://forum.nginx.org/read.php?3,129805,129811
https://forum.directadmin.com/threads/php-fpm-5-6-and-7-0-error-restart-every-minute.54709/
There are multiple possible causes, but I did find one that caused the issue in our system. I had monit set up to restart processes if they failed. I had a custom monit config file that looked for the php-fpm socket. We updated php-fpm from PHP 7.3 to 7.4 and the name of the socket file changed. So monit decided that php-fpm wasn't running and restarted it every minute. Changing the monit config file fixed the problem.
When requesting http://server-ip the default "Welcome to nginx" page is returned.
When requesting http://server-ip/phpinfo.php 404 is returned. No errors in the error log, but GET 404 in access log
If location ~ \.php$ is removed from the conf then phpinfo.php is downloaded as a file when requested
setup
apt-get install nginx
apt-get install php5-fpm php5-mysqlnd
conf
server {
listen 80;
server_name localhost;
location / {
root /var/www;
index index.php index.html index.htm;
try_files $uri $uri/ =404;
}
location ~ \.php$ {
try_files $uri =404;
include fastcgi_params;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
php cli
This works as expected
php -f /var/www/phpinfo.php
php-fpm
# ps aux | grep php-fpm
root 1555 0.0 0.1 183508 20976 ? Ss 16:20 0:00 php-fpm: master process (/etc/php5/fpm/php-fpm.conf)
www-data 1557 0.0 0.0 183508 7152 ? S 16:20 0:00 php-fpm: pool www
www-data 1558 0.0 0.0 183508 7152 ? S 16:20 0:00 php-fpm: pool www
root 1932 0.0 0.0 12720 2080 pts/0 S+ 16:23 0:00 grep php-fpm
nginx version
# nginx -v
nginx version: nginx/1.8.0
PHP doesn't integrate with nginx the same way it does with Apache. You'll need to launch the PHP daemon separately.
sudo service php5-fpm restart
See here for more details.
After using the conf files from nginx 1.6.3 it works :)