Welcome! Log In Create A New Profile

Advanced

Can't make Nginx 1.5.7 to work with PHP5-FPM

Posted by Fnux 
Can't make Nginx 1.5.7 to work with PHP5-FPM
December 12, 2013 10:27AM
Hello all,

I've installed the last Nginx mainline 5.1.7 on a fresh install of Ubuntu 12.04.3 LTS 64 running PHP5-FPM 5.5.6-1.

My simple problem is that I can't make Nginx to work with PHP5-FPM.

Any request to a PHP file results in a Not found message.

Below are my settings:

etc/nginx/nginx.conf

user nginx;
worker_process 8;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 8192;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log off;
sendfile on;
tcp_nopush on;
keepalive_timeout 64;
gzip on;
gzip_min_length 500;
include /etc/nginx/conf.d/*.conf;
}

etc/ngin/conf.d/default.conf

server {
listen 80;
server_name localhost;
access_log off;
location / {
root /var/www;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www;
}
location ~ \.php$ {
root html
fastcgi_pass 127.0.0.1:9000;
# fastcgi_pass /var/run/php5-fpm.sock;
fastcgi_index index.pp;
fastcgi_parms SCRIPT_FILENAME /scripts$fastcgi_script_name;
include fastcgi_params;
}
}

/etc/php5/fpm/php-fpm.conf

[global]
pid = /var/run/php5-fpm.pid
error_log = /var/log/php5-fpm.log
include=/etc/php5/fpm/pool.d/*.conf

/etc/ph5/fpm/pool.d/www.conf

[www]
user = www-data
group = www-data
listen = 127.0.0.1:9000
; listen = /var/run/php5-fpm.sock
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
chdir = /

Now, whenever I change the listen directive to /var/run/php5-fpm.sock in both /etc/nginx/conf.d/default.conf and /etc/php5/fpm/pool.d/www.conf does not change the problem.

Any help and advice would be truly appreciated since I'm sure I'm wrong somewhere.

TIA.

Hardware : CPU AMD FX 8150 @ 4.2 GHz. RAM 32 Gb. DUAL SSD Cucial 240 Gb.
OS : ArchLinux 64, CentOS 64, Debian 7 64, Fedora 19 64, LinuxMint 15 64, Manjaro 64, RHEL 64 64, Ubuntu 12.04.3 LTS 64 & Windows 7 Ultimate 64.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 247
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready