Welcome! Log In Create A New Profile

Advanced

Unable to see a php page

Mahmood Naderan
March 15, 2020 08:30AM
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@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@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
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Unable to see a php page

Mahmood Naderan March 15, 2020 08:30AM

Re: Unable to see a php page

Francis Daly March 15, 2020 09:24AM

Re: Unable to see a php page

Mahmood Naderan March 15, 2020 09:52AM

Re: Unable to see a php page

Francis Daly March 15, 2020 10:02AM

Re: Unable to see a php page

Ian Hobson March 16, 2020 11:14AM

Re: Unable to see a php page

Mahmood Naderan March 16, 2020 02:12PM

Re: Unable to see a php page

Francis Daly March 20, 2020 05:32PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 74
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready