Unable to see a php page

Mahmood Naderan mahmood.nt at gmail.com
Sun Mar 15 12:28:30 UTC 2020


Hi,
For a test, I have installed nginx 1.0.15 with php 5.3 on an Ubuntu 14.04.
The settings related to php in nginx.conf are as below where I removed the
comments for simplicity.


    server {
        listen       80;
        server_name  localhost;
        location / {
            root   /home/ubuntu/htdocs/;
            index  index.html index.htm;
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
        location ~ \.php$ {
            root           /home/ubuntu/htdocs/public_html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME
 /home/ubuntu/htdocs/public_html/$fastcgi_script_name;
            include        fastcgi_params;
        }
    }


The document root is here.

ubuntu at fr13:~$ ls -l htdocs/
total 36
-rw-r--r-- 1 www-data www-data 1422 مارس  15 15:28 build.xml
drwxr-xr-x 2 www-data www-data 4096 مارس  15 15:28 classes
drwxr-xr-x 2 www-data www-data 4096 مارس  15 15:28 controllers
drwxr-xr-x 2 www-data www-data 4096 مارس  15 15:35 etc
drwxr-xr-x 2 www-data www-data 4096 مارس  15 15:28 includes
-rw-r--r-- 1 www-data www-data  152 مارس  15 15:29 index.html
drwxr-xr-x 2 www-data www-data 4096 مارس  15 15:28 lib
drwxr-xr-x 6 www-data www-data 4096 مارس  15 15:28 public_html
drwxr-xr-x 2 www-data www-data 4096 مارس  15 15:28 views


The index.html is a simple welcome message.


Also

ubuntu at fr13:~$ ls -l htdocs/public_html/index.php
-rw-r--r-- 1 www-data www-data 7556 مارس  15 15:28
htdocs/public_html/index.php




When I open the browser and enter localhost, I can see the welcome message.
That means the basic functionality is fine.

However, when I enter localhost/public_html/index.php

I get this message in the browser:


The page you are looking for is temporarily unavailable.
Please try again later.


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: 127.0.0.1, server:
localhost, request: "GET /public_html/index.php HTTP/1.1", upstream:
"fastcgi://127.0.0.1:9000", host: "localhost"


Why I get connection refused?
What else should I check for more debugging?



Regards,
Mahmood
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20200315/17fe1e18/attachment.htm>


More information about the nginx mailing list