HI! Just setting up my site... first thing I see after domain working is.....

Fatal error: Call to undefined function session_is_registered() in /home/vhosts/www.universal-abundance.com/config.php on line 87

Any ideas..... I'm db impaired!

Thanks,
L-D

Dani AI

Generated

Quick summary and what actually caused the fatal error: the script was calling the old PHP function session_is_registered() which no longer exists on modern PHP builds. As suggested, checking the PHP version is a good first step, and as pointed out that function is an obsolete API. ultimately avoided the issue by moving hosts, but for future readers the safe options are to update the script or add a small compatibility shim.

If you can edit the code, the modern approach is to start the session early and use the $SESSION superglobal (do not rely on `session*` helper functions). Example pattern to use at the top of a page or in your config:

<?php
if (session_status() === PHP_SESSION_NONE) {
    session_start();
}
// set a value
$_SESSION['user_id'] = $userId;
// check a value
if (!empty($_SESSION['user_id'])) {
    // proceed
}
?>

If you cannot immediately rewrite every legacy call, add a short polyfill (temporary) so the old calls do not fatal out while you migrate:

<?php
if (!function_exists('session_is_registered')) {
    function session_is_registered($key) {
        return !empty($_SESSION) && array_key_exists($key, $_SESSION);
    }
}
?>

Other practical tips:

  • Ensure session_start() runs before any output. Otherwise checks will silently fail or misbehave.
  • Search the codebase for other deprecated calls (session_register, session_unregister) and replace them with assignments to $_SESSION / unset($_SESSION['key']). A recursive search (IDE or grep -R "session_" .) helps find all occurrences.
  • If you see a blank page while testing, enable full error reporting during debugging (or check the webserver/PHP error log) so fatal errors are visible.
  • Long-term: update the script to modern PHP idioms; running insecure or abandoned third-party scripts on current PHP versions carries security risk.

This addresses the underlying compatibility problem without repeating the earlier snippets, and gives quick, actionable fixes you can apply immediately.

Recommended Answers

All 13 Replies

What script do you try to install?
Make sure that your mysql settings are correct in config file.
What code is on line 87?
Your question is very broad, it can be anything.

Maybe you are using PHP V5.4 ?

Hi,

It is a cashgiftingpro script w/5 levels BUT I converted it to advertising, one banner or text ad per
level. Ads are in a iframe. Starts at $5 up to $250.

I put the config here

The new site, universal-abundance.com is on http://www.freewebhostingarea.com

Can't find info on PHP V5.4 or any other.

Thanks!
LD

Warning
This function has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0.

taken from php manual( )

If $_SESSION (or $HTTP_SESSION_VARS for PHP 4.0.6 or less) is used, use isset() to check a variable is registered in $_SESSION.

For eg:-
now use

$_SESSION["name"]="iim";
if(isset($_SESSION["name"]))//this(unset()) is used to check if session variable is set.
{
//your code
}

Hopefully it is clear.

Is this for L-D? Don't have a clue... I'm a HTML guy.

add a test page to your site containing

<?php phpinfo(); ?>

and see what it displays

I tried and htm and txt with <?php phpinfo(); ?> at top. Just get a blank pg. Told you I'm db impaired!

How do I make it show up? I did this long time ago but don't remember.

:-/ LD

Change it to:-

<?php phpinfo(); die; ?>

Ok, I did ...still a blank pg. I refreshed too. Does there have to be anything else on the page, like <HTML>, etc?

I'm php impaired too!

LD

Try this

<?php echo PHP_VERSION; die;?>

Now we're talking. 5.4.16

Thanks
LD

Back to the error message:
Fatal error: Call to undefined function session_is_registered() in /home/vhosts/www.universal-abundance.com/config.php on line 87

Thanks,
LD

Hi paulkd,

I've solved the problem... I moved to another server! But for other reasons...

Thanks for your help... but I may be back!?

L-D

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.