Jump to content
TNG Community
fluffy82

Problem switching to PHP 8.0.16

Recommended Posts

fluffy82

I tried switching my PHP version to 8.0.16 today, and noticed none of the TNG pages are working. The WordPress pages on my website work perfectly.

The TNG pages just give me a white screen. Not only getperson, but also the search page, the surname list etc. I've browsed through a handful of them, none work.
When I switch back to PHP 7.4.28, they work again.

Is that normal? I thought the last update to v13.1.1 was supposed to accommodate PHP 8?

Share this post


Link to post
Share on other sites
fluffy82

PS the admin part still works in PHP 8.0.16, it's only the user part that turns white; all my mods are currently deactivated, and anyway also pages not influenced by any mods don't work, so it must be something in the "core files"...

Share this post


Link to post
Share on other sites
Ken Roy
15 hours ago, fluffy82 said:

I thought the last update to v13.1.1 was supposed to accommodate PHP 8?

Tom,

The PHP developers are continually making changes, so they may have broken something.  You will need to look at the PHP error log to find the error and post the error here.

Share this post


Link to post
Share on other sites
klooster

If you are using WP, it is probably a plugin problem, disable all you plugins, then check if TNG works, then activate the WP plugins one by one to find the culprit.

I had the same problem with the WPOptimize plugin

Share this post


Link to post
Share on other sites
fluffy82
6 hours ago, Ken Roy said:

You will need to look at the PHP error log to find the error and post the error here.

The PHP error log only shows errors on WordPress pages, it ignores the TNG pages because they're "outside" the environment... :(

I installed a mod once to get PHP error logs in TNG, but that never worked so I uninstalled it. I'll see if I can reinstall it and make it work somehow.

23 minutes ago, klooster said:

If you are using WP, it is probably a plugin problem

It's definitely a TNG problem. The WordPress pages work fine, no issues there. Only the TNG pages don't work. The WP plugins don't affect the TNG pages (I wish they would, but they don't).

Share this post


Link to post
Share on other sites
klooster

You are using my TNG_WP integration, that means that every TNG page first loads WP and activate its plugins, some plugins can conflict with the TNG loading afterwards in PHP 8+

Just disable the plugins and check if the theTNG pages are loading, have you done that??

Do not forget that WP plugins and TNG are both using a lot of jquery files, minify etc. So some plugins can certainly interfere with the loading of the TNG pages

Share this post


Link to post
Share on other sites
fluffy82
3 minutes ago, klooster said:

You are using my TNG_WP integration, that means that every TNG page first loads WP, some plugins can conflict with the TNG loading afterwards in PHP 8+

Just disable the plugins and check if the theTNG pages are loading, have you done that??

It only loads the header, which it also loads on WP pages. Those work fine, so the header (and everything loaded with it) is not the issue.

I'm now first trying to get to work the PHP Error Log thing. I'll try uninstalling the plugins later. Though I really don't understand how the same plugins would load perfectly fine in WordPress, but suddenly stop working when displaying TNG. If you could elaborate on how that's possible, I'd be grateful to learn. My skills are only basic, and every opportunity to learn something new is a good one.

Share this post


Link to post
Share on other sites
klooster

No it is not just loading the header, it LOADS WP and if WP is loaded it activates the plugins and  then gets the header.

Do not forget that WP plugins and TNG are both using a lot of jquery files (some the same). etc. So some plugins can certainly interfere with the loading of the TNG pages

Share this post


Link to post
Share on other sites
fluffy82
7 hours ago, Ken Roy said:

You will need to look at the PHP error log to find the error and post the error here.

Ok, I think I managed to get the Error Log working. When visiting a page, it now immediately displays a Fatal Error in stead of a blank page, even though the Error Log in the Admin area says the file is empty. It says:

Fatal error: Uncaught Error: Undefined constant "�tngpath�" in /var/www/vhosts/huygens-vandemoortel-ancestry.be/httpdocs/tng_11/WPTNG-meta.php:1 Stack trace: #0 /var/www/vhosts/huygens-vandemoortel-ancestry.be/httpdocs/tng_11/genlib.php(167): include() #1 /var/www/vhosts/huygens-vandemoortel-ancestry.be/httpdocs/tng_11/getperson.php(145): tng_header() #2 {main} thrown in /var/www/vhosts/huygens-vandemoortel-ancestry.be/httpdocs/tng_11/WPTNG-meta.php on line 1

This was when trying to access a person profile. he other pages (search form, statisics, surname list,...) give an identical error, only the part highlighted in red changes to the page I'm trying to access.

Share this post


Link to post
Share on other sites
fluffy82
9 minutes ago, klooster said:

Do not forget that WP plugins and TNG are both using a lot of jquery files, minify etc. So some plugins can certainly interfere with the loading of the TNG pages

Ok, that makes sense. Thanks.

Share this post


Link to post
Share on other sites
klooster

So what is line 1 in your wptng-meta.php?

Share this post


Link to post
Share on other sites
fluffy82
10 minutes ago, klooster said:

So what is line 1 in your wptng-meta.php?

<?php   global $cms;  ?>  <link href=�<?php echo $cms[�tngpath�]; ?>  css/mytngstyle.css� rel=�stylesheet� type=�text/css�/> 

I have no idea what these diamond question marks are, I never put them there... I didn't touch this file.

EDIT: when I revert to PHP 7.4 (the one where TNG still works), this file remains identical; 

Share this post


Link to post
Share on other sites
klooster

Try this instead:

 

<link href="https://www.huygens-vandemoortel-ancestry.be/tng_11/css/mytngstyle.css" rel="stylesheet" type="text/css" />

PS:

Share this post


Link to post
Share on other sites
fluffy82
2 minutes ago, klooster said:

Try this instead:

 

<link href="https://www.huygens-vandemoortel-ancestry.be/tng_11/css/mytngstyle.css" rel="stylesheet" type="text/css" />

PS:

You're the greatest! It works.

So the problem was it didn't know what the tngpath variable was? Why doesn't PHP 8 recognise it, but PHP 7 does? Any idea?

Share this post


Link to post
Share on other sites
fluffy82

Ok, installing my mods made other errors appear. I'll have to install them one by one to see which ones work, and which don't. That'll be a job for over the weekend.

EDIT: I found a moment to check them, and the two only issues (on the getperson page anyway) seem to be:

Share this post


Link to post
Share on other sites
Ken Roy

Tom,

why are you wanting to use PHP 8.0.16?   I have no clue what version of PHP Darrin used to test TNG 13.1.1 before it was released, but I have only used PHP 8.0.8 on my WampServer and my host only offers PHP 8.0.2 and PHP 8.1.1 which breaks mods that had been made PHP 8 compliant?

Edited by Ken Roy
correct information

Share this post


Link to post
Share on other sites
fluffy82
16 minutes ago, Ken Roy said:

Tom,

why are you wanting to use PHP 8.0.16?   I have no clue what version of PHP Darrin is testing with, but I have only used PHP 8.0.8 on my WampServer and my host only offers PHP 8.0.2 and PHP 8.1.1 which breaks mods that had been made PHP 8 compliant?

I don't have another choice. It's either PHP 7.4.26 or PHP 8.0.16.

Using PHP 7.4.26 works fine, so I could leave that set. But I did get a notification that it will soon be "deprecated" or whatever word they used, and I was advised to switch to PHP 8.
8.0.16 is the only one available on my provider, I don't have 8.0.8, 8.0.2 or 8.1.1.

Share this post


Link to post
Share on other sites
klooster

I am also using PHP 8.0.16 but with no problems, see screenshot of my mods:

PS: mods 37-44 (TNG …..) are personal made mods I use

7BFAE2EB-4AC1-45B4-9CFE-55EC42E17FE0.png

Share this post


Link to post
Share on other sites
theKiwi
3 hours ago, fluffy82 said:

<?php   global $cms;  ?>  <link href=�<?php echo $cms[�tngpath�]; ?>  css/mytngstyle.css� rel=�stylesheet� type=�text/css�/> 

I have no idea what these diamond question marks are, I never put them there... I didn't touch this file.

 

The black diamonds are almost certainly because that line has "smart" or "curly" quote marks “ ’ ‘  “ ” in it, not "straight" marks ' "

Roger

Share this post


Link to post
Share on other sites
Ken Roy

If PHP 7.4.26 is available, I would remain with it until TNG 3.1.2 comes out unless you want to pioneer and help users find the code that needs to be fixed for higher levels of PHP.

1 hour ago, klooster said:

I am also using PHP 8.0.16 but with no problems 

Thanks Cees,

Sounds like mods might be the issue then. 

4 hours ago, fluffy82 said:

EDIT: I found a moment to check them, and the two only issues (on the getperson page anyway) seem to be:

I do not use the 3 mods identified.   I  made my comment based on having to fix mods that work in PHP 8.0.8 no longer working correctly under PHP 8.1.1

Share this post


Link to post
Share on other sites
fluffy82
10 minutes ago, Ken Roy said:

If PHP 7.4.26 is available, I would remain with it until TNG 3.1.2 comes out unless you want to pioneer and help users find the code that needs to be fixed for higher levels of PHP.

I'll stick to 7.4.26 for now then. I can go look up which lines of code it gives me as an error, but I wouldn't know how to "solve" them, my php knowledge is too limited for that.

Share this post


Link to post
Share on other sites
klooster

Like Roger posted, PHP used to allow both square brackets and curly braces to be used interchangeably for accessing array elements and string offsets, see example:

------------------------

$array = [1, 2]; echo $array[1]; // prints 2

echo $array{1}; // also prints 2   $string = "foo";

echo $string[0]; // prints "f"

echo $string{0}; // also prints "f"

--------------------------------------

  • From PhP 8+ the curly braces are depreciated.

All accesses to array elements and string offsets now show a deprecation message:

PHP Deprecated: Array and string offset access syntax with curly braces is deprecated in ……..
 

Share this post


Link to post
Share on other sites
Michel KIRSCH
On 3/15/2022 at 1:04 PM, Ken Roy said:

I am also using PHP 8.0.16 but with no problems

My online site uses PHP 8.1 without problems or warnings

but don't use the 3 mods cited by Tom

Michel

Share this post


Link to post
Share on other sites
Ken Roy

Note that TNG full install fails on PHP 8.1.1 and other code needs to be fixed, so I would not recommend that anyone jump on PHP 8.1

Mods that work on PHP 8.0 also produce errors on PHP 8.1.  With Michel's help I recently fixed the Living Flag and Private Flag Backup / Restore mods. 

 

Share this post


Link to post
Share on other sites
tngrlkrz
1 hour ago, Michel KIRSCH said:

My online site uses PHP 8.1 without problems or warnings

FWIW, I am TNG 13.1.1 with  90 installed mods on a remote test site with  PHP 8.1.1 w/o no additional warnings (which is very few) than I had with PHP 8.0.7.  But I will heed Ken's warning about full install issues and likely keep PHP 8.1.1 in test mode only.

List of Installed Mods

But I also am not running the 3 mods mentioned by Tom.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×