Jump to content

Call to undefined function: start_session()


Recommended Posts

I get this error when im trying to access my site that ive just moved from windows to linux.

Fatal error: Call to undefined function: start_session() in /var/www/virtual/xxxxxxx.xxx/htdocs/config.php on line 123

This is what is on line 123 and around.
Anyone know what im doing wrong ?
// Initialize the session(s)
if(session_id() == ""){
}else {
$smarty->assign("a_session__id", session_id() );
//echo " session_name = " .session_name(). ", <BR><BR> session_id = " . session_id();
Link to comment
Share on other sites

It's hard to believe php would let you get away using the wrong one all this time.
Most likely you were and just don't remember, unless your server had some crackheaded setup, or there is a setup info in the php.ini that can set session_start to stay on all the time, maybe on all your other server's that was inabled, so start_session (incorrect name) was called, it was ignored but everything still worked, because the ini had it set too.
Link to comment
Share on other sites

session_start is the correct function to start a session and always has been. There is no setting in the php.ini that can allow you to use start_session to start a session.

However I think you have misread/misinterpreted what businessman said. What businessman said was perhaps your other servers had a setting a called [b]session.auto_start[/b] enabled which would start the session automatically without you explicitly telling PHP to start a session in your script. However if PHP cannot find a function when you call for it it will produce a fatal error. Fatal errors will stop the script from working so this cannot be the case.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.