<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif">Thank you for the feedback. I want to do some tests on a VM albeit the versions are old.</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">I started php-fpm and opened localhost/index.php</div><div class="gmail_default" style="font-family:tahoma,sans-serif">This time I see the content of index.php as a plain text.</div><div class="gmail_default" style="font-family:tahoma,sans-serif">I have to do more debugging. Thanks.</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><font face="tahoma,sans-serif">Regards,<br>Mahmood</font><br><br><br></div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Mar 15, 2020 at 4:53 PM Francis Daly <<a href="mailto:francis@daoine.org">francis@daoine.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Sun, Mar 15, 2020 at 03:58:30PM +0330, Mahmood Naderan wrote:<br>
<br>
Hi there,<br>
<br>
> For a test, I have installed nginx 1.0.15 with php 5.3 on an Ubuntu 14.04.<br>
<br>
> At the same time, I see this entry in /usr/local/nginx/logs/error.log<br>
> <br>
> 2020/03/15 15:50:20 [error] 4808#0: *5 connect() failed (111: Connection<br>
> refused) while connecting to upstream, client: 127.0.0.1, server:<br>
> localhost, request: "GET /public_html/index.php HTTP/1.1", upstream:<br>
> "fastcgi://<a href="http://127.0.0.1:9000" rel="noreferrer" target="_blank">127.0.0.1:9000</a>", host: "localhost"<br>
> <br>
> <br>
> Why I get connection refused?<br>
> What else should I check for more debugging?<br>
<br>
nginx does not "do" php. nginx expects that you have a separate thing<br>
-- in this case, a fastcgi server listening on tcp port 9000 -- that<br>
handles php.<br>
<br>
"Connection refused" suggests that you are not running a fastcgi server<br>
there that nginx can access.<br>
<br>
You will want to find the Ubuntu method of running the PHP fastcgi<br>
service, possibly called "php-fpm"; and making sure that it is listening<br>
for requests in the place where your nginx does "fasctgi_pass" to.<br>
<br>
(As an aside -- the version numbers you mention are not the newest. It<br>
is possible that there are some bugs in those versions that mean that<br>
they do not work well together. If that happens, then you may have more<br>
debugging to do, or choose to use newer versions of things.)<br>
<br>
And also -- based on your config, you probably want to make a request for<br>
<a href="http://localhost/index.php" rel="noreferrer" target="_blank">http://localhost/index.php</a>, not <a href="http://localhost/public_html/index.php" rel="noreferrer" target="_blank">http://localhost/public_html/index.php</a>.<br>
But that will only matter after the current error is resolved.<br>
<br>
Good luck with it,<br>
<br>
f<br>
-- <br>
Francis Daly <a href="mailto:francis@daoine.org" target="_blank">francis@daoine.org</a><br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</blockquote></div></div>