Nginx + php-fpm Connection refused problem

Source: Internet
Author: User
Tags fpm

Use the Yum installed PHP-FPM, always throw the wrong time:

Connect () failed (111:connection refused) while connecting to upstream, client:127.0.0.1, Server:localhost

Appears to be nginx not even to PHP-FPM, find to find out, found is the problem of PHP-FPM configuration:

Open PHP-FPM configuration file:/etc/php-fpm.d/www.conf,

Find Listen =/run/php-fpm/www.sock,

Because the Nginx is a match:

Location ~ \.php (. *) $ {

                        fastcgi_pass   127.0.0.1:9000;

                        Fastcgi_index  index.php;

                        Fastcgi_split_path_info  ^ (? U). +\.php) (/?. +)$;

                        Fastcgi_param  script_filename  $document _root/$fastcgi _script_name;

                        Include Fastcgi_params;

        }

Nginx with: Fastcgi_pass 127.0.0.1:9000; TCP socket Mode

So the corresponding listen =/run/php-fpm/www.sock in php-fpm

Also change to: listen = 127.0.0.1:9000 or Direct listen = 9000,


About Fastcgi_pass, reference: Http://wiki.nginx.org/HttpFastcgiModule#fastcgi_pass

About the difference between a TCP socket and a UNIX socket, refer to: http://serverfault.com/questions/124517/ Whats-the-difference-between-unix-socket-and-tcp-ip-socket


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.