Thread View: rocksolid.shared.helpdesk
25 messages
25 total messages
Started by Anonymous@novabb
Thu, 18 Mar 2021 18:46
Index.php
Author: Anonymous@novabb
Date: Thu, 18 Mar 2021 18:46
Date: Thu, 18 Mar 2021 18:46
3 lines
418 bytes
418 bytes
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
Re: Index.php
Author: Anonymous
Date: Thu, 18 Mar 2021 12:30
Date: Thu, 18 Mar 2021 12:30
5 lines
354 bytes
354 bytes
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
Re: Index.php
Author: Anonymous@novabb
Date: Thu, 18 Mar 2021 19:43
Date: Thu, 18 Mar 2021 19:43
4 lines
149 bytes
149 bytes
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
Re: Index.php
Author: Anonymous@novabb
Date: Thu, 18 Mar 2021 20:00
Date: Thu, 18 Mar 2021 20:00
3 lines
168 bytes
168 bytes
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
Re: Index.php
Author: retro.guy@rockso
Date: Fri, 19 Mar 2021 00:00
Date: Fri, 19 Mar 2021 00:00
20 lines
927 bytes
927 bytes
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
Re: Index.php
Author: Anonymous@novabb
Date: Fri, 19 Mar 2021 17:42
Date: Fri, 19 Mar 2021 17:42
27 lines
1183 bytes
1183 bytes
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
None
Author: Anonymous
Date: Sat, 20 Mar 2021 04:37
Date: Sat, 20 Mar 2021 04:37
25 lines
958 bytes
958 bytes
>>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
Re: index.php
Author: Anonymous
Date: Sat, 20 Mar 2021 04:46
Date: Sat, 20 Mar 2021 04:46
19 lines
512 bytes
512 bytes
>>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
Re: Index.php
Author: retro.guy@rockso
Date: Sat, 20 Mar 2021 08:06
Date: Sat, 20 Mar 2021 08:06
43 lines
1647 bytes
1647 bytes
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
Re: None
Author: retro.guy@rockso
Date: Sat, 20 Mar 2021 11:59
Date: Sat, 20 Mar 2021 11:59
43 lines
1412 bytes
1412 bytes
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
Re: Index.php
Author: Anonymous@novabb
Date: Sat, 20 Mar 2021 19:08
Date: Sat, 20 Mar 2021 19:08
13 lines
636 bytes
636 bytes
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
Re: Index.php
Author: Anonymous@novabb
Date: Sun, 21 Mar 2021 02:21
Date: Sun, 21 Mar 2021 02:21
13 lines
691 bytes
691 bytes
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
Re: Index.php
Author: Anonymous
Date: Sun, 21 Mar 2021 06:07
Date: Sun, 21 Mar 2021 06:07
6 lines
280 bytes
280 bytes
>>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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads