#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2009
    Posts
    335
    Rep Power
    247

    111: conection refused - nginx & php5-fpm


    Hi,

    I seem unable to get php to run under nginx.

    I have configured the server as follows

    nginx.conf
    Code:
        # Upstream to abstract back-end connection(s) for PHP
        upstream php {
          server unix:/var/run/php5-fpm.sock;
        }
    I have the site fpm config (dmo.conf)
    Code:
    listen = unix:/var/run/php5-fpm.sock;
    I have the nginx site (dmo.org) in available-sites set as
    Code:
           location ~ \.php$ {
                try_files $uri =404;
                include /etc/nginx/fastcgi_params;
                fastcgi_pass php;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_param PATH_INFO $fastcgi_script_name;
                
            }
    I have dmo.org in my host file and the index.html file runs fine, however, when I try to access a PHP file I get ...
    [error] 3639#0: *29 connect() to unix:/var/run/php5-fpm.sock failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: dmo, request: "GET /info.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "www.dmo.org"
    Any ideas why PHP won't run?

    Thanks,
    1DMF
    Free MP3 Dance Music Downloads

    To err is human; To really balls things up you need Microsoft!
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2009
    Posts
    335
    Rep Power
    247
    Finally found a config that actually works!

    1st thing to do is 'DO NOT Google' or search the net for an answer 95% of all info is wrong, Google is most definitely not your friend and 100% your enemy!

    Follow this guide and you should be good to go :-)

    http://michael.lustfield.net/nginx/d...tting-up-nginx
    Free MP3 Dance Music Downloads

    To err is human; To really balls things up you need Microsoft!

IMN logo majestic logo threadwatch logo seochat tools logo