“Undefined function”: Time to upgrade

Like TNG, the underlying PHP is constantly changing, and new updates are released every few months. Hosting providers don’t always install the latest version right away, but they almost always get to it eventually.

When that happens, there are usually a handful of PHP functions that for whatever reason are no longer supported in the newer version. For example, the “session_register” and “session_unregister” functions were removed a while back, and all the “mysql” functions (like mysql_query) were removed with the jump to PHP 7.0.

I have always tried to keep pace with these changes, removing functions like that from the TNG code before PHP removes them, so if you keep your TNG up to date you shouldn’t experience any problems. If you’re still running an older version of TNG, however, you may suddenly run into trouble if your hosting provider upgrades PHP without notice. It won’t affect every page on your site, but if you happen to execute some of the problem code, you’ll be stopped short. Sometimes you might get a blank page, but most of the time you’ll see an error message like this:

Fatal error: Call to undefined function session_register() in /public_html/genealogy/globallib.php on line 5

It’s possible that a message like this would refer to a TNG problem, like if a key file was missing. If you want to know for sure, do a Google search on the the middle part of the error message (“Call to undefined function session_register()”, in this instance). If it’s just a problem with your TNG files, you probably won’t get many results. If the function named is one that PHP has removed though, you should see several hits referring to that fact, and you can know that it’s time to upgrade TNG.

To get the upgrade at a discount, you can always go back to your previous TNG downloads page. The payment options will be visible in the “TNG Updates” section. If you’ve lost the access info for that page, please feel free to drop me a note.