Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  nodelist  faq  

If you think education is expensive, try ignorance. -- Derek Bok, president of Harvard


rocksolid / Helpdesk / Index.php

SubjectAuthor
* Index.phpAnonymous
+* Re: Index.phpAnonymous
|`- Re: Index.phpAnonymous
+- Re: Index.phpAnonymous
+* Re: Index.phpRetro Guy
|`* Re: Index.phpAnonymous
| `- Re: Index.phpRetro Guy
+* NoneAnonymous
|`- Re: NoneRetro Guy
+- Re: index.phpAnonymous
+* Re: Index.phpAnonymous
|`- Re: Index.phpAnonymous
`- Re: Index.phpAnonymous

1
Subject: Index.php
From: Anonymous
Newsgroups: rocksolid.shared.helpdesk
Organization: novaBBS
Date: Thu, 18 Mar 2021 18:46 UTC
Date: Thu, 18 Mar 2021 18:46:00 +0000
Subject: Index.php
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on novabbs
From: Anonym...@novabbs.i2p (Anonymous)
Newsgroups: rocksolid.shared.helpdesk
X-Rslight-Site: $2y$10$jArtU/ntlyVd.v9e6j7Bg..WZREVDU/b3PmWguUCY/kefefi7iePy
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
User-Agent: Rocksolid Light (news.novabbs.com/getrslight)
Organization: novaBBS
Message-ID: <004340660dca675f38b0b60146db264c$1@www.novabbs.com>
View all headers
Hello. I’ve run into some trouble with Nginx. I’ve set up Nginx and for some reason, Nginx is only taking in index.html, not index.php. I’ve included index.php in the index directive and also enabled Nginx php support in the default.conf. I’m using the latest versions of Nginx and php. I don’t see why Nginx would only take in html files. Any help would be appreciated.
--
Posted on novaBBS
www.novabbs.com



Subject: Re: Index.php
From: Anonymous
Newsgroups: rocksolid.shared.helpdesk
Organization: rocksolid2 (novabbs.org)
Date: Thu, 18 Mar 2021 19:30 UTC
Path: i2pn2.org!rocksolid2!.POSTED.127.139.135.22!not-for-mail
From: pos...@anon.com (Anonymous)
Newsgroups: rocksolid.shared.helpdesk
Subject: Re: Index.php
Date: Thu, 18 Mar 2021 12:30:04 -0700
Organization: rocksolid2 (novabbs.org)
Message-ID: <he.697.38x9ni@anon.com>
References: <004340660dca675f38b0b60146db264c$1@www.novabbs.com>
Content-Type: text/plain; charset=UTF-8
Injection-Info: novabbs.org; posting-account="def2"; posting-host="127.139.135.22";
logging-data="26080"; mail-complaints-to="usenet@novabbs.org"
View all headers
Sounds to me like you have done all the right steps.
First question: did you restart the service to apply the changes you have made ?
Second question: do you maybe have both index.html and index.php in your directory, and index.html at the first place in the conf file ? In this case index.html is prioritized if both files are there.

--
Posted on def2


Subject: Re: Index.php
From: Anonymous
Newsgroups: rocksolid.shared.helpdesk
Organization: novaBBS
Date: Thu, 18 Mar 2021 19:43 UTC
Date: Thu, 18 Mar 2021 19:43:35 +0000
Subject: Re: Index.php
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on novabbs
From: Anonym...@novabbs.i2p (Anonymous)
Newsgroups: rocksolid.shared.helpdesk
X-Rslight-Site: $2y$10$dngcKynrdpsh6bxvPcrJTOlQzWcVptgEofpWrMhJ4AZybjcI7JAq.
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
User-Agent: Rocksolid Light (news.novabbs.com/getrslight)
References: <004340660dca675f38b0b60146db264c$1@www.novabbs.com> <he.697.38x9ni@anon.com>
Organization: novaBBS
Message-ID: <72ded0faabcb2b0592619efcbd9e0fb8$1@news.novabbs.com>
View all headers
I restarted the services many times (both Nginx and the FPM) and index.php is prioritized over index.html.
-_-
--
Posted on novaBBS
news.novabbs.com



Subject: Re: Index.php
From: Anonymous
Newsgroups: rocksolid.shared.helpdesk
Organization: novaBBS
Date: Thu, 18 Mar 2021 20:00 UTC
Date: Thu, 18 Mar 2021 20:00:00 +0000
Subject: Re: Index.php
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on novabbs
From: Anonym...@novabbs.i2p (Anonymous)
Newsgroups: rocksolid.shared.helpdesk
X-Rslight-Site: $2y$10$PY90Zid0nPfLi1IuNpjAV./MKodXKMr7znFxlrY0Mx09cELC/YzLa
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
User-Agent: Rocksolid Light (news.novabbs.com/getrslight)
References: <004340660dca675f38b0b60146db264c$1@www.novabbs.com>
Organization: novaBBS
Message-ID: <d8b31d8517e8c4ccdd2f78c14bf246a2$1@news.novabbs.com>
View all headers
Also, if I remove the Nginx error message, I get a 502 Bad Gateway error. Not sure if that information was really needed, though.
--
Posted on novaBBS
news.novabbs.com



Subject: Re: Index.php
From: Retro Guy
Newsgroups: rocksolid.shared.helpdesk
Organization: novaBBS
Date: Fri, 19 Mar 2021 00:00 UTC
Date: Fri, 19 Mar 2021 00:00:18 +0000
Subject: Re: Index.php
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on novabbs
From: retro....@rocksolidbbs.com (Retro Guy)
Newsgroups: rocksolid.shared.helpdesk
X-Rslight-Site: $2y$10$WY25scUryG/Gb9LfwRBcbe8fZu7e3G9urSDXzr.H6XzvVAdGdeYqy
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
User-Agent: Rocksolid Light (news.novabbs.com/getrslight)
References: <004340660dca675f38b0b60146db264c$1@www.novabbs.com>
Organization: novaBBS
Message-ID: <c1f13f591e10f8310d2593e6cdfd3f89$1@www.novabbs.com>
View all headers
Anonymous wrote:

Hello. I’ve run into some trouble with Nginx. I’ve set up Nginx and for some reason, Nginx is only taking in index.html, not index.php. I’ve included index.php in the index directive and also enabled Nginx php support in the default.conf. I’m using the latest versions of Nginx and php. I don’t see why Nginx would only take in html files. Any help would be appreciated.

Are you using php-fpm? If so, have you specifically installed it and is it running?

default.conf should point .php to it and fastcgi_pass should match php-fpm setting:

   location ~ .php$ {
            fastcgi_split_path_info ^(.+.php)(/.+)$;
            fastcgi_pass unix:/run/php/php7.0-fpm.sock;
            fastcgi_index index.php;
   }

In /etc/php/7.0/fpm/pool.d/www.conf (or wherever it is on your system):

listen = /run/php/php7.0-fpm.sock
is what should match in default.conf
--
Posted on novaBBS
www.novabbs.com



Subject: Re: Index.php
From: Anonymous
Newsgroups: rocksolid.shared.helpdesk
Organization: novaBBS
Date: Fri, 19 Mar 2021 17:42 UTC
Date: Fri, 19 Mar 2021 17:42:07 +0000
Subject: Re: Index.php
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on novabbs
From: Anonym...@novabbs.i2p (Anonymous)
Newsgroups: rocksolid.shared.helpdesk
X-Rslight-Site: $2y$10$u.Qe2l/Li.6sXjtvNshzM.D4A606nh.fdKrbgRaLXm27e3QsUHKDu
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
User-Agent: Rocksolid Light (news.novabbs.com/getrslight)
References: <004340660dca675f38b0b60146db264c$1@www.novabbs.com> <c1f13f591e10f8310d2593e6cdfd3f89$1@www.novabbs.com>
Organization: novaBBS
Message-ID: <92301c9a4a4f580efdd629d811abd303$1@news.novabbs.com>
View all headers
Yup. I have installed it, it's properly running, and fastcgi_pass matches www.conf. Although, I get a "File Not Found." error and a "404 Forbidden" error when I change the fastcgi_split_path_info information. I also sometimes get a "FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream" error depending on what I change fastcgi_split_path_info to. Fastcgi_split_path_info is something I don't really understand, and I'm thinking it may be the problem. If possible, do you know what exactly this means?

Also, here's the default.conf file set up.

server {
    listen       80;
    server_name  localhost;

location / {
        root   /usr/share/nginx/html;
        index index.php index.html index.htm;
    }
error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }
location ~ .php$ {
         fastcgi_split_path_info ^(.+.php)(/.+)$;
         fastcgi_index index.php;
         include /etc/nginx/fastcgi_params;
         fastcgi_pass unix:/var/run/php/php8.0-fpm.sock;
         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}

}
--
Posted on novaBBS
news.novabbs.com



Subject: Re: Index.php
From: Retro Guy
Newsgroups: rocksolid.shared.helpdesk
Organization: Rocksolid Light
Date: Sat, 20 Mar 2021 08:06 UTC
Path: i2pn2.org!.POSTED!not-for-mail
From: retro....@rocksolidbbs.com (Retro Guy)
Newsgroups: rocksolid.shared.helpdesk
Subject: Re: Index.php
Date: Sat, 20 Mar 2021 08:06:11 +0000
Organization: Rocksolid Light
Message-ID: <51b6a07b1dda56bd9381871928514dcb$1@news.novabbs.org>
References: <004340660dca675f38b0b60146db264c$1@www.novabbs.com> <c1f13f591e10f8310d2593e6cdfd3f89$1@www.novabbs.com> <92301c9a4a4f580efdd629d811abd303$1@news.novabbs.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org; posting-account="retrobbs1";
logging-data="19902"; mail-complaints-to="usenet@i2pn2.org"
User-Agent: Rocksolid Light (news.novabbs.com/getrslight)
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on novabbs.org
X-Rslight-Site: $2y$10$grfFfK/0Pvc2hR2GLNW6mOxIk4RtMjHuAuqD8M.YnJDwXBw/VW.uq
View all headers
Anonymous wrote:

Yup. I have installed it, it's properly running, and fastcgi_pass matches www.conf. Although, I get a "File Not Found." error and a "404 Forbidden" error when I change the fastcgi_split_path_info information. I also sometimes get a "FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream" error depending on what I change fastcgi_split_path_info to. Fastcgi_split_path_info is something I don't really understand, and I'm thinking it may be the problem. If possible, do you know what exactly this means?

fastcgi_split_path_info is where it identifies that it's a php script and breaks the script part of the line apart from the rest of the url. Your line (below) looks ok.

Also, here's the default.conf file set up.

server {
    listen       80;
    server_name  localhost;

location / {
        root   /usr/share/nginx/html;
        index index.php index.html index.htm;
    }

Take the two lines above out of 'location / { }' so:

  listen 80;
  server_name localhost;
  root /usr/share/nginx/html;
  index index.php index.html index.htm;

location / {
  whatever you want here if you still need it
}

error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }
location ~ .php$ {
         fastcgi_split_path_info ^(.+.php)(/.+)$;
         fastcgi_index index.php;
         include /etc/nginx/fastcgi_params;
         fastcgi_pass unix:/var/run/php/php8.0-fpm.sock;
         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}

}
--
Posted on Rocksolid Light
news.novabbs.org


Subject: None
From: Anonymous
Newsgroups: rocksolid.shared.helpdesk
Organization: def2
Date: Sat, 20 Mar 2021 11:37 UTC
Path: i2pn2.org!i2pn.org!rocksolid2!.POSTED.127.139.135.22!not-for-mail
From: pos...@anon.com (Anonymous)
Newsgroups: rocksolid.shared.helpdesk
Subject: None
Date: Sat, 20 Mar 2021 04:37:06 -0700
Organization: def2
Message-ID: <he.702.3853js@anon.com>
References: <004340660dca675f38b0b60146db264c$1@www.novabbs.com>
Content-Type: text/plain; charset=UTF-8
Injection-Info: novabbs.org; posting-account="def2"; posting-host="127.139.135.22";
logging-data="17525"; mail-complaints-to="usenet@novabbs.org"
View all headers
dd79947c1c324bb920
fastcgi_split_path_info is where it identifies that it's a php script and breaks the script part of the line apart from the rest of the url. Your line (below) looks ok.

interesting, i don't use this at all (i mean fastcgi_split_path_info).

instead, i use this construction (and it works well for me):

location ~ (index|register)\.php$ {
                include snippets/fastcgi-php.conf;
                fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
        }

the line with the snippets is mandatory I think (at least I seem to remember it did not work without, cannot test this now).

how about you post your full /etc/nginx/nginx.conf and /etc/nginx/sites-available/yoursite.conf, best as text attachments ?
also the output of
 
service nginx status
cat /var/log/nginx/error.log
cat /var/log/syslog
journalctl -xe

could be of help (but those could contain sensitive data, too, so check first what you post).

--
Posted on def2


Subject: Re: index.php
From: Anonymous
Newsgroups: rocksolid.shared.helpdesk
Organization: def2
Date: Sat, 20 Mar 2021 11:46 UTC
Path: i2pn2.org!rocksolid2!.POSTED.127.139.135.22!not-for-mail
From: pos...@anon.com (Anonymous)
Newsgroups: rocksolid.shared.helpdesk
Subject: Re: index.php
Date: Sat, 20 Mar 2021 04:46:51 -0700
Organization: def2
Message-ID: <he.703.2vg5my@anon.com>
References: <004340660dca675f38b0b60146db264c$1@www.novabbs.com>
Content-Type: text/plain; charset=UTF-8
Injection-Info: novabbs.org; posting-account="def2"; posting-host="127.139.135.22";
logging-data="20985"; mail-complaints-to="usenet@novabbs.org"
View all headers
6dbd12bd184daead51
Also, if I remove the Nginx error message,

Remove it from where ? the config file ?

I get a 502 Bad Gateway error.

This means usually that the backend (so php in your case) does not answer to the request. This could have a bunch of reasons, like:
-service not running
-service is overloaded
-not enough ram
-you ran out of hd space
and so on.

Not sure if that information was really needed, though.

Sure, this could point to the reason your setup does not work.

--
Posted on def2


Subject: Re: None
From: Retro Guy
Newsgroups: rocksolid.shared.helpdesk
Organization: Rocksolid Light
Date: Sat, 20 Mar 2021 11:59 UTC
Path: i2pn2.org!.POSTED!not-for-mail
From: retro....@rocksolidbbs.com (Retro Guy)
Newsgroups: rocksolid.shared.helpdesk
Subject: Re: None
Date: Sat, 20 Mar 2021 11:59:56 +0000
Organization: Rocksolid Light
Message-ID: <5b4d75beef1c0c1c745558f86ce949db$1@news.novabbs.org>
References: <004340660dca675f38b0b60146db264c$1@www.novabbs.com> <he.702.3853js@anon.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org; posting-account="retrobbs1";
logging-data="3574"; mail-complaints-to="usenet@i2pn2.org"
User-Agent: Rocksolid Light (news.novabbs.com/getrslight)
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on novabbs.org
X-Rslight-Site: $2y$10$OoksqbzDE8jDyugxgvjYu.MGoK9CKVOG7gbtTZJpG9Tzxaq1G7EbW
View all headers
Anonymous wrote:

dd79947c1c324bb920
fastcgi_split_path_info is where it identifies that it's a php script and breaks the script part of the line apart from the rest of the url. Your line (below) looks ok.

interesting, i don't use this at all (i mean fastcgi_split_path_info).

instead, i use this construction (and it works well for me):

location ~ (index|register).php$ {
                include snippets/fastcgi-php.conf;
                fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
        }

the line with the snippets is mandatory I think (at least I seem to remember it did not work without, cannot test this now).

Sometimes nginx makes my brain hurt, lol :)

I don't have anything with the snippets line. Here's what I use:

    location ~ .php$ {
            fastcgi_split_path_info ^(.+.php)(/.+)$;
            fastcgi_pass unix:/run/php/php7.0-fpm.sock;
            fastcgi_index index.php;
            include fastcgi.conf;
    }

Here's my version:
nginx version: nginx/1.10.3

how about you post your full /etc/nginx/nginx.conf and /etc/nginx/sites-available/yoursite.conf, best as text attachments ?
also the output of

service nginx status
cat /var/log/nginx/error.log
cat /var/log/syslog
journalctl -xe

could be of help (but those could contain sensitive data, too, so check first what you post).

Good idea.
--
Posted on Rocksolid Light
news.novabbs.org


Subject: Re: Index.php
From: Anonymous
Newsgroups: rocksolid.shared.helpdesk
Organization: novaBBS
Date: Sat, 20 Mar 2021 19:08 UTC
Date: Sat, 20 Mar 2021 19:08:55 +0000
Subject: Re: Index.php
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on novabbs
From: Anonym...@novabbs.i2p (Anonymous)
Newsgroups: rocksolid.shared.helpdesk
X-Rslight-Site: $2y$10$r4AwBzneg2spPH6zSVfreulOcF9xyNvTVE1Ou.D.9evSuooxN6KxO
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
User-Agent: Rocksolid Light (news.novabbs.com/getrslight)
References: <004340660dca675f38b0b60146db264c$1@www.novabbs.com>
Organization: novaBBS
Message-ID: <573a77caea36dd1c5812f23d0617b0b4$1@news.novabbs.com>
View all headers
SOLVED.

What was the problem? I kept on confusing the screen of death as a problem with the FPM. So I kept on tampering with the configuration files that eventually resulted in many different kinds of errors. Took me days of a lot of stress and brainwork to figure that out. There was a semicolon missing in the index file.

MORAL OF THE STORY: Please please PLEASE. Be smarter than me. MUCH smarter than me. Especially when dealing with technology. It requires you to be smarter than this.

Also, thanks for everyone for trying to help me.

END.

-_-  -_-  -_-  -_-  -_-  -_-  -_-  -_-  -_-  -_-
--
Posted on novaBBS
news.novabbs.com



Subject: Re: Index.php
From: Anonymous
Newsgroups: rocksolid.shared.helpdesk
Organization: novaBBS
Date: Sun, 21 Mar 2021 02:21 UTC
Date: Sun, 21 Mar 2021 02:21:21 +0000
Subject: Re: Index.php
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on novabbs
From: Anonym...@novabbs.i2p (Anonymous)
Newsgroups: rocksolid.shared.helpdesk
X-Rslight-Site: $2y$10$jw293.6J5MH7o/5xDQ46fe3ezoTHr7At.jbQq2YZwykVlCtedIGuO
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
User-Agent: Rocksolid Light (news.novabbs.com/getrslight)
References: <004340660dca675f38b0b60146db264c$1@www.novabbs.com> <573a77caea36dd1c5812f23d0617b0b4$1@news.novabbs.com>
Organization: novaBBS
Message-ID: <e105b2bec9260404d5bfd91d5df98ae5$1@www.novabbs.com>
View all headers
Anonymous wrote:

SOLVED.

What was the problem? I kept on confusing the screen of death as a problem with the FPM. So I kept on tampering with the configuration files that eventually resulted in many different kinds of errors. Took me days of a lot of stress and brainwork to figure that out. There was a semicolon missing in the index file.

That happens to all of us. Mismatched brackets in code drive me nuts!

MORAL OF THE STORY: Please please PLEASE. Be smarter than me. MUCH smarter than me. Especially when dealing with technology. It requires you to be smarter than this.

We're not smarter than you. It's just how stuff gets figured out.
--
Posted on novaBBS
www.novabbs.com



Subject: Re: Index.php
From: Anonymous
Newsgroups: rocksolid.shared.helpdesk
Organization: rocksolid2 (novabbs.org)
Date: Sun, 21 Mar 2021 13:07 UTC
Path: i2pn2.org!rocksolid2!.POSTED.127.139.135.22!not-for-mail
From: pos...@anon.com (Anonymous)
Newsgroups: rocksolid.shared.helpdesk
Subject: Re: Index.php
Date: Sun, 21 Mar 2021 06:07:07 -0700
Organization: rocksolid2 (novabbs.org)
Message-ID: <he.709.25c3xb@anon.com>
References: <004340660dca675f38b0b60146db264c$1@www.novabbs.com>
Content-Type: text/plain; charset=UTF-8
Injection-Info: novabbs.org; posting-account="def2"; posting-host="127.139.135.22";
logging-data="4501"; mail-complaints-to="usenet@novabbs.org"
View all headers
581941429bf1086008
There was a semicolon missing in the index file.
lol, we have all been there.
in fact, this kind of thing happens a lot to me. i have just got better and better in finding the shit, and i also changed some of my coding habits as a result.

--
Posted on def2


1
rocksolid light 0.6.9
clearneti2ptor