# Nginx and php-fpm on WIndows

**URL:** <https://www.ruby-forum.com/t/nginx-and-php-fpm-on-windows/224729>\
**Category:** NGINX\
**Created:** [November 23, 2012, 3:05pm UTC](https://www.ruby-forum.com/t/nginx-and-php-fpm-on-windows/224729 "2012-11-23T15:05:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [November 23, 2012, 3:05pm UTC](https://www.ruby-forum.com/t/nginx-and-php-fpm-on-windows/224729/1 "2012-11-23T15:05:06Z")

</div>

Hello,  
I try nginx on Windows 7 with php-fpm for development on local machine.  
Nginx configuration is set to cooperate with php-fpm. But when I try  
show my  
index.php from document root directory, I see only blank page. Source of  
this page is exactly the php code in index.php file. No error is showed,  
no  
errors in logs.

When I try this on Mac, all works. What can be wrong here?  
Here is nginx.conf file. Conf file php-fpm.conf don’t exists on windows,  
but  
php-fpm runs without errors.

Thank you.

#user nobody;  
worker\_processes 1;

error\_log logs/error.log;  
#error\_log logs/error.log notice;  
#error\_log logs/error.log info;

#pid logs/nginx.pid;

events {  
worker\_connections 1024;  
}

http {  
include 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 logs/access.log main;

sendfile on;
#tcp_nopush on;

#keepalive_timeout 0;
keepalive_timeout 65;

#gzip on;

server {
    listen 80;
    server_name localhost;

    #charset koi8-r;

    #access_log logs/host.access.log main;

    location / {
        root D:/Web/www;
        index index.html index.htm index.php;
    }

    #error_page 404 /404.html;

    # redirect server error pages to the static page /50x.html
    #
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
        root html;
    }

    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    #
    #location ~ \.php$ {
    # proxy_pass http://127.0.0.1;
    #}

    # pass the PHP scripts to FastCGI server listening on

```

127.0.0.1:9000  
#  
location ~ .php$ {  
root D:/Web/www;  
fastcgi\_pass 127.0.0.1:9000;  
fastcgi\_index index.php;  
fastcgi\_param SCRIPT\_FILENAME  
$document\_root$fastcgi\_script\_name;  
include fastcgi\_params;  
}

```
    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    # deny all;
    #}
}

# another virtual host using mix of IP-, name-, and port-based

```

configuration  
#  
#Server {  
# listen 8000;  
# listen somename:8080;  
# server\_name somename alias another.alias;

```
# location / {
# root html;
# index index.html index.htm;
# }
#}

# HTTPS server
#
#server {
# listen 443;
# server_name localhost;

# ssl on;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;

# ssl_session_timeout 5m;

# ssl_protocols SSLv2 SSLv3 TLSv1;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;

# location / {
# root html;
# index index.html index.htm;
# }
#}

```

}

Posted at Nginx Forum:

> **[Nginx and php-fpm on WIndows](https://forum.nginx.org/read.php?2,233185,233185#msg-233185)**
>
> Hello, I try nginx on Windows 7 with php-fpm for development on local machine. Nginx configuration is set to cooperate with php-fpm. But when I try show my index.php from document root directory, I see only blank page. Source of this page is exactly...
