Unable to see a php page

Francis Daly francis at daoine.org
Sun Mar 15 13:23:10 UTC 2020

On Sun, Mar 15, 2020 at 03:58:30PM +0330, Mahmood Naderan wrote:

Hi there,

> For a test, I have installed nginx 1.0.15 with php 5.3 on an Ubuntu 14.04.

> At the same time, I see this entry in /usr/local/nginx/logs/error.log
> 2020/03/15 15:50:20 [error] 4808#0: *5 connect() failed (111: Connection
> refused) while connecting to upstream, client:, server:
> localhost, request: "GET /public_html/index.php HTTP/1.1", upstream:
> "fastcgi://", host: "localhost"
> Why I get connection refused?
> What else should I check for more debugging?

nginx does not "do" php. nginx expects that you have a separate thing
-- in this case, a fastcgi server listening on tcp port 9000 -- that
handles php.

"Connection refused" suggests that you are not running a fastcgi server
there that nginx can access.

You will want to find the Ubuntu method of running the PHP fastcgi
service, possibly called "php-fpm"; and making sure that it is listening
for requests in the place where your nginx does "fasctgi_pass" to.

(As an aside -- the version numbers you mention are not the newest. It
is possible that there are some bugs in those versions that mean that
they do not work well together. If that happens, then you may have more
debugging to do, or choose to use newer versions of things.)

And also -- based on your config, you probably want to make a request for
http://localhost/index.php, not http://localhost/public_html/index.php.
But that will only matter after the current error is resolved.

Good luck with it,

Francis Daly        francis at daoine.org

More information about the nginx mailing list