I have nginx, php 5 and php5-fpm installed on ubuntu 10.04 server
edition.
After I started the nginx server, I have no problem loading the regular
html pages. but all .php pages cannot be viewed, firefox just pop out a
window asking me if I wnat to download the file.
I also tried IE, on IE, it just shows the source code.
I checked both nginx and php5-fpm error log files, didn’t see any
errors. did I miss something during the configuration?
I dont know if the problem is nginx or php5_fpm, I need someone to
point me to the rite direction
Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,134116,134116#msg-134116
Sounds like you’re missing a php location block. You need to show us
your config. Pastebin it
HI, Mike.
here’s my nginx.conf.
user www-data www-data;
worker_processes 4;
events {
worker_connections 4;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
tcp_nopush on;
tcp_nodelay off;
keepalive_timeout 5;
gzip on;
gzip_comp_level 2;
gzip_proxied any;
gzip_types text/plain text/css application/x-javascript
text/xml application/xml application/xml+rss text/javascript;
include /usr/local/nginx/sites-enabled/*;
}
mike Wrote:
problem loading the regular
configuration?
Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,134116,134119#msg-134119
Show us which sites-enabled site config this is.
Mike, you are rite. I replace my “default” file with this one. now
everything works.
server {
server_name localhost;
listen 80; # listen on port 80
root /www; # our root document path
index index.php index.html index.htm;
location ~* \.php$ { # for requests ending with .php
# specify the listening address and port that you configured
previously
fastcgi_pass 127.0.0.1:9000;
# the document path to be passed to PHP-FPM
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# the script filename to be passed to PHP-FPM
fastcgi_param PATH_INFO $fastcgi_script_name;
# include other FastCGI related configuration settings
include fastcgi_params;
}
}
Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,134116,134133#msg-134133
in my “/usr/local/nginx/sites-enabled”, theres only one file “default”
here’s the code.
server {
listen 80;
server_name localhost;
location / {
root html;
index index.php index.html index.htm;
}
# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location = /50x.html
{
root html;
}
}
mike Wrote:
Show us which sites-enabled site config this is.
On Sep 25, 2010, at 5:34 PM, “feelexit” wrote:
Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,134116,134124#msg-134124