Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: Lord991 on April 23, 2020, 01:45:06 PM

Title: Some pages blank - php version?
Post by: Lord991 on April 23, 2020, 01:45:06 PM
Ok guys, we just moved forum (SMF2.0.17) from one host where PHP version was 5.6 to a new host where PHP version is 7.2 and some pages like Core Features, Features and Options, Security and Moderation, Modification Settings in Admin panel doesn't work, only white blank page shows up or "This page isn't working".

We tried changing PHP version in cPanel back to 5.6 but it doesn't have any effect.

Also our error log is full of these: 2: Parameter 1 to shd_buffer_replace() expected to be a reference, value given

Any solutions to this problem?
Thanks
Title: Re: Some pages blank - php version?
Post by: Shambles on April 23, 2020, 02:04:58 PM
Can you give examples of the full error message?

Do you have the Simple Help Desk mod installed?
Title: Re: Some pages blank - php version?
Post by: vbgamer45 on April 23, 2020, 02:05:41 PM
What mods do you have installed shd_buffer_replace is not in 2.0.17 the default install.

Should work fine on 7.2 I run SMF on 7.3
Title: Re: Some pages blank - php version?
Post by: drewactual on April 23, 2020, 02:07:32 PM
do you still have copies of the site from the old server?

how did you package and move them?

i'd be more concerned something was left behind or lost in the move than version of php...  just a thought.
Title: Re: Some pages blank - php version?
Post by: Shambles on April 23, 2020, 02:14:04 PM
That function is declared in Subs-SimpleDesk.php.

The full error message will show which module is calling that function with a value rather than with a reference.

My guess is that there's a setting in the php.ini that's more strict in your new installation.
Title: Re: Some pages blank - php version?
Post by: Lord991 on April 23, 2020, 02:17:56 PM
We've managed to change the PHP version back to 5.6 and pages showed up, but there seems to be some error with logout now and the session.

The mod Simple Help Desk is deleted now.
The concern is that if we delete SHD mod and change PHP back to 7.3 the pages are still blank.

And for the session problem, I've tried changing Cookie name, deleting cache and switch browsers but I still can't logout. 
Title: Re: Some pages blank - php version?
Post by: vbgamer45 on April 23, 2020, 02:21:07 PM
Try changing to under cookies and sessions to database driven sessions or uncheck it what ever is set.

For simple desk what version of the mod was it?
Also any logs in your webserver error log
Title: Re: Some pages blank - php version?
Post by: Arantor on April 23, 2020, 02:22:15 PM
To fix the SimpleDesk error you were seeing (which won't be the cause of your problem), in Subs-SimpleDesk.php there is the 'function shd_buffer_replace' definition, which will have a & before the parameter; take that out.
Title: Re: Some pages blank - php version?
Post by: Lord991 on April 23, 2020, 02:33:33 PM
Thank you all for SimpleDesk fix, we decided to remove that mod anyway.

(https://i.imgur.com/zYMlKP0.png)

This is the settings for Cookies and sessions, but the issue is still there. After clicking logout second theme there is a message: Session verification failed. Please try logging out and back in again, and then try again.

Title: Re: Some pages blank - php version?
Post by: Shambles on April 23, 2020, 02:35:51 PM
Personally, I'd set the "Use database driven sessions" option.
Title: Re: Some pages blank - php version?
Post by: Arantor on April 23, 2020, 02:36:29 PM
Still going to need the server error logs.

DB driven sessions is a good choice, depends mostly on how busy you are (after a while, there are better and more efficient options)
Title: Re: Some pages blank - php version?
Post by: Lord991 on April 23, 2020, 02:46:18 PM
I can't find any server error log for this time, there is an older log ...
Also, there is no logged any error in forum logs.

I'm going to change PHP back to 7.3 now without SHD mod installed, maybe it generates new error.
Title: Re: Some pages blank - php version?
Post by: Arantor on April 23, 2020, 02:48:25 PM
When you say 'you deleted the mod', how exactly did you do that out of interest?
Title: Re: Some pages blank - php version?
Post by: Lord991 on April 23, 2020, 02:58:01 PM
Uninstalled from the package manager? There were no errors while uninstalling process.

Now with PHP 7.3 the problem is here again with the blank pages.

Now the server error logs show: PHP Fatal error:  Redefinition of parameter $nul in /home/hostname/public_html/forum/Sources/ManageSettings.php on line 2764
On that line, there is some CustomForm probably some mod.

We don't mind being on PHP 5.6 as long as we can fix this logout session problem. Any advice?

EDIT: It's strange we have exact forum copy on an old host with PHP 5.6 working just fine and logout work also.

Maybe some PHP 5.6 extensions are not enabled on the new host? There is still no error in any log.

Title: Re: Some pages blank - php version?
Post by: Arantor on April 23, 2020, 03:30:19 PM
I wouldn't stay on PHP 5.6 seeing how it stopped getting security patches in 2018.

The ManageSettings.php issue I've seen before, the line has $nul, $nul, $nul in it, you can safely change this to $nul, $nul2, $nul3. Try changing that before going further.

There are no relevant extensions in 5.6 that wouldn't be available in 7.x (except mysql, which is replaced out for mysqli in 2.0.14+)
Title: Re: Some pages blank - php version?
Post by: Lord991 on April 23, 2020, 03:57:31 PM
Ok Arantor, this is the outcome:
I've changed PHP to 7.3, and change this $nul to $nul2 and $nul3, and now the pages like Core Features shows up normally.

The only problem left is this logout session.

There is no new errors in any log.
Title: Re: Some pages blank - php version?
Post by: Arantor on April 23, 2020, 04:03:33 PM
What are your cache settings set to?
Title: Re: Some pages blank - php version?
Post by: Lord991 on April 23, 2020, 04:06:52 PM
It's Level 1 Caching..
Title: Re: Some pages blank - php version?
Post by: Arantor on April 23, 2020, 04:15:14 PM
That's not the only setting on that page.
Title: Re: Some pages blank - php version?
Post by: Lord991 on April 23, 2020, 04:19:34 PM
Memcache settings field is blank. Load balancing is disabled.
Title: Re: Some pages blank - php version?
Post by: Arantor on April 23, 2020, 04:27:34 PM
So I guess you're using the file caching? (It's been so long since I looked at 2.0 that I'd forgotten there wasn't the 2.1 style dropdown for cache selection)

Try emptying the file cache. The menu *shouldn't* be cached but it is possible. Especially if you have any other mods listed (which wasn't confirmed despite being asked).
Title: Re: Some pages blank - php version?
Post by: Lord991 on April 23, 2020, 04:37:44 PM
I've tried emptying the file cache but its the same. I've tried deleting my browser cache, session storage, cookies, even other browsers but it doesn't help.
Mod list: https://i.imgur.com/I1dFcQh.png

It has to be something with host, the forum is exactly the same as on old host.
Title: Re: Some pages blank - php version?
Post by: Lord991 on April 24, 2020, 10:43:32 AM
Marked solved.

I've reinstalled SMF updates to 2.0.14 and then installed new versions one by one.

Thanks everyone for helping me.

EDIT:
Again
An Error Has Occurred!
Your session timed out while posting. Please go back and try again.
Title: Re: Some pages blank - php version?
Post by: HRM on January 24, 2021, 04:31:22 AM
Quote from: Arantor on April 23, 2020, 03:30:19 PM
I wouldn't stay on PHP 5.6 seeing how it stopped getting security patches in 2018.

The ManageSettings.php issue I've seen before, the line has $nul, $nul, $nul in it, you can safely change this to $nul, $nul2, $nul3. Try changing that before going further.

There are no relevant extensions in 5.6 that wouldn't be available in 7.x (except mysql, which is replaced out for mysqli in 2.0.14+)

Thanks a lot Arantor!!!

This solution did it for me. This bug was bothering me for about a year but had no time before to check my own forum. Now did a little search checked server logs and got it.