Fixing PHP Fatal error: Call to undefined function session_register()

Monday, 1st July 2013

While moving Website from older Debian 6 to Debian 7 server with Apache I encountered PHP Fatal error:

PHP Fatal error:  Call to undefined function session_register() in /var/www2/site/www/include/modules/core/session.class.php on line 7, referer: http://192.168.1.9/

In PHP newer than PHP 5.3, session_register(): function is obsolete, there is no need anymore to have this function initiated before using SESSION variables.

Comment out  in PHP files prompting error in Apache error.log everywhere where matched:

session_register();
session_register('session');

 

to look like this:
 

//session_register();
//session_register('session');

In newer PHP versions to initialize sessions:

 $_SESSION['session']="session_variable";

Before test it again in browser, restart Browser and Apache server to make sure some caching from Apache or Browser doesn't influence. That's all now site  works fine 🙂

Share this on:

More helpful Articles

Download PDFDownload PDF

Tags: , , , , , , , , ,

One Response to “Fixing PHP Fatal error: Call to undefined function session_register()”

  1. Teena Burkhart says:
    Google Chrome 67.0.3396.87 Google Chrome 67.0.3396.87 Windows 10 x64 Edition Windows 10 x64 Edition
    Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36,gzip(gfe)

    I precisely had to say thanks all over again. I am not sure the things that I could possibly have used without the entire creative ideas documented by you directly on that situation. Previously it was the fearsome scenario in my position, nevertheless noticing the very specialised mode you managed it made me to weep with delight. I am just happy for your support and have high hopes you really know what a great job your are accomplishing instructing many people with the aid of your website. Probably you haven’t got to know all of us.

    View CommentView Comment

Leave a Reply

CommentLuv badge