Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: zaks_bg on August 14, 2022, 02:16:40 PM

Title: Forum opens blank page for guests on index.php
Post by: zaks_bg on August 14, 2022, 02:16:40 PM
We have been trying to fix an issue with the forum (SMF 2.0.19) for quite some time. It seems guests can't open/load the forum home page. If they try a different forum page URL - it is ok. The problem does not seem to be related to the theme, it happens on the default themes too. Also registered users are ok to see the main forum page. The forum does not have any restrictions for the guests to see it.

Here is the home page, which can not load as guest:
https://motivirai.me/forum/

And here is a random topic, which could be opened by anybody:
https://motivirai.me/forum/index.php/topic,48.msg1132.html

Also if you open the second link as a guest and try any of the pages above, but the main page - it will be fine, but if you click on the main page  "Начало" - again a blank page and the forum doesn't load... weird.

Please, any help would be appreciated.
Title: Re: Forum opens blank page for guests on index.php
Post by: Shambles on August 14, 2022, 03:36:46 PM
Hi,

Just to exclude one or two things, could you go to your admin panel > configuration > features & options > general and untick the box labeled "Search engine friendly URLs" (don't forget to hit the save button at the bottom).

And see if that makes a difference?

Also, anything pertinent in your forum error log?
Title: Re: Forum opens blank page for guests on index.php
Post by: Sir Osis of Liver on August 14, 2022, 04:58:05 PM
Mods?
Title: Re: Forum opens blank page for guests on index.php
Post by: Doug Heffernan on August 14, 2022, 05:29:29 PM
When did this happen for the first time? What modifications/changes were made to the forum prior to it happening?
Title: Re: Forum opens blank page for guests on index.php
Post by: Sir Osis of Liver on August 14, 2022, 06:00:29 PM
Wasn't this reported recently?  IIRC (I may not), it was a permissions problem with a portal.
Title: Re: Forum opens blank page for guests on index.php
Post by: zaks_bg on August 15, 2022, 06:24:35 AM
SE friendly links: disabled ... no improvement

Mods: The only one except the upgrades from 2.0.15 - 2.0.19 is Ad Managment 3.5d

Not sure when it happened for the first time, seems long time ago as I understand now.

The folder/files permissions are not any different than they should be - most of them being 755. Also looked at htaccess - no such file in the /forum subfolder, Have one in the main folder, but nothing concerning related to the /forum subfolder permissions
Title: Re: Forum opens blank page for guests on index.php
Post by: Kindred on August 15, 2022, 07:13:56 AM
If it happens only on the main forum page and not on any page that has an argument, like boards or message threads --  then the issue is almost definitely something that is displayed only on the main index page.
Try disabling the advert mod.

if not that, then load a clean set of files.
Title: Re: Forum opens blank page for guests on index.php
Post by: Dzonny on August 15, 2022, 07:24:19 AM
Maybe something was left in .htaccess file? Still looks like something that a url related mod would do.
Title: Re: Forum opens blank page for guests on index.php
Post by: SpacePhoenix on August 15, 2022, 03:33:34 PM
Anything in PHP's error log?
Title: Re: Forum opens blank page for guests on index.php
Post by: zaks_bg on August 16, 2022, 06:37:52 AM
Ok, I have been trying to replace all the files using the full upgrade option... and Im stuck at the FTP information.... created new FTP user especially for it... and still I cant pass it... :(( //All the info there is correct (even the admin login - tried disabling it too) but keeps getting me back to the same page without any errors

(https://i.ibb.co/CsjrsXz/upgrade-smf.png)


--
BTW I have found where the problem comes from (by just replacing file) ... it is from the Bulgarian translation of the core and default themes. If I don't update the themes with BG language ones (the most recent ones) - the forum loads ok... Needless to say - it does not work properly as all characters are unreadable... so I'm stuck for the moment... at least the Upgrade module should worked properly, alas it doesn't
Title: Re: Forum opens blank page for guests on index.php
Post by: Dzonny on August 16, 2022, 06:44:35 AM
Okay, let's go one step at the time.

Firstly use repair_settings.php (https://wiki.simplemachines.org/smf/Repair_settings.php) to change default language to English.
Then try to click on list of files in upgrade.php page to see which files/directories should have chmod changed, and you can use FTP client to appropriately adjust those. Then you should be able to run upgrade without entering those FTP info.
Title: Re: Forum opens blank page for guests on index.php
Post by: zaks_bg on August 16, 2022, 07:54:05 AM
As I expected, it didn't work...

As a desperate step I uploaded my back-uped 'Settings_bak.php' (I didn't have such a file before that, as I delete all the files from /forum root, except settings.php and set it up to write mode.)... and guess what- the upgrade managed to finish :)... That's plain stupid. Please fix the upgrader to not need Settings_bak.php at all, why would it need it ??? (it really searches for such a file to be existent, while it shouldn't, as settings.php should be completely enough).

---
And The forum is completely not readable now (As I changed to english) - as its not meant to be read in English. But I am afraid if I overwrite the BG themes - again it won't be accessible for guests (verified - when I switch to Bulgarian language - it is again not accessible to guests on the main page)... anybody else with some ideas?
Title: Re: Forum opens blank page for guests on index.php
Post by: Dzonny on August 16, 2022, 08:25:49 AM
Upgrade should work really easy, please take a look at doc:
Upgrading SMF (https://wiki.simplemachines.org/smf/Upgrading)

Whatever language you're using on forum English as default language must be readable if everything is working fine.

So change default language to English, upload whole upgrade pack to forum root and overwrite current files, run upgrade.php and everything should work.
If you still need a hand with it you can pm me FTP details so I can take a look, if you feel comfortable for that.
Title: Re: Forum opens blank page for guests on index.php
Post by: zaks_bg on August 16, 2022, 08:46:53 AM
As I mentioned the upgrade is done already (and yes, being in English allows guests to load the main page BUT),  none of the content is readable on English settings, check it out yourself:
https://motivirai.me/forum/index.php

---
If I go to languages and set it to Bulgarian UTF-8 it becomes readable, but then the guests can't load the main page. If you have like 15mins, I can share screens with you via skype so you can try and help, please?
Title: Re: Forum opens blank page for guests on index.php
Post by: zaks_bg on August 16, 2022, 08:56:26 AM
LOL, I also noticed English default is ISO-8859-1 ... So I checked and downloaded English (UTF8) ... why there are diff versions of English, and why the default one in the default package is not UTF8 ???

Now the content is readable... but again the guests can't load the main page ... what a mess :)

---
To summarize
if english ISO-8859-1 -> forum not readable but guests can load the main page
if english UTF-8 or Bulgarian UTF-8 -> forum is readable and guests can not load the main page
Title: Re: Forum opens blank page for guests on index.php
Post by: Dzonny on August 16, 2022, 09:17:05 AM
There are reasons why 2.0 branch had two set of language files. 2.1 branch is utf8 by default. Have you consider upgrading to 2.1 maybe?

I can't access index.php at this point.

When you say that the content is not readable, you mean the posts itself? The ones written in cyrilic characters?

Also, you haven't answered to my question about .htaccess file, do you have it, and if so, can you attach it pls?
Title: Re: Forum opens blank page for guests on index.php
Post by: zaks_bg on August 16, 2022, 09:41:54 AM
you can open a random page like
https://motivirai.me/forum/index.php?topic=48
but not the 'home / начало' page

--
No htaccess file on forum lvl, just one in my main folder but it has nothing to do with the forum, here is the content, only some https rewrites and deny for xmlrpc hacks:

<FilesMatch "xmlrpc\.php$">
order deny,allow
deny from all
</FilesMatch>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R=301,L]

# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Title: Re: Forum opens blank page for guests on index.php
Post by: Dzonny on August 16, 2022, 09:51:21 AM
Can you please try to remove the whole wp part of the code from .htaccess just temporarly to see if there's any change.

So the file should look like:

<FilesMatch "xmlrpc\.php$">
order deny,allow
deny from all
</FilesMatch>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R=301,L]
Title: Re: Forum opens blank page for guests on index.php
Post by: zaks_bg on August 16, 2022, 10:12:58 AM
Already have tried this before, tried it now again... no improvement
Also, I have tried deleting completely the htaccess file... no improvement

Obviously the problem is somewhat related to the UTF-8 languages and/or UTF8 DB ... as if non-UTF8 language is selected the main page loads... it's unreadable (yes - the content/the Cyrillic) though
Title: Re: Forum opens blank page for guests on index.php
Post by: Kindred on August 16, 2022, 02:03:44 PM
you can not just use the UTF8 language pack.

In 2.0.x, if you are using the UTF8 language, then you ALSO need to have your database set to use UTF8 for collation.

It sounds like - somehow, you have gotten your forum into a state where it doesn't know what to do.
Title: Re: Forum opens blank page for guests on index.php
Post by: zaks_bg on August 16, 2022, 02:19:30 PM
All DB tables are utf8_general_ci
Title: Re: Forum opens blank page for guests on index.php
Post by: Kindred on August 16, 2022, 04:19:00 PM
And the columns in those tables ?
Title: Re: Forum opens blank page for guests on index.php
Post by: zaks_bg on August 17, 2022, 12:49:19 AM
Same
Title: Re: Forum opens blank page for guests on index.php
Post by: Dzonny on August 17, 2022, 06:35:49 AM
Literally all tables and columns?

Just asking again, have you considered upgrading to 2.1 branch at some point?
How big your forum is, is the DB huge, can't see stats right now?
Title: Re: Forum opens blank page for guests on index.php
Post by: Kindred on August 17, 2022, 07:01:39 PM
If you truly are getting a blank white page on the forum load, in the form mode, there should be a server error log somewhere. If there is not, you should talk to your host because a blank page indicates a PHP failure And that should be logged by the server

 However without more information it is very hard to help you debug your situation.