Nicarlo Posted November 3, 2006 Share Posted November 3, 2006 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 123This is what is on line 123 and around.Anyone know what im doing wrong ?[code]// Initialize the session(s)if(session_id() == ""){ //session_name($MySQL_SESSION); start_session(); }else { $smarty->assign("a_session__id", session_id() ); //echo " session_name = " .session_name(). ", <BR><BR> session_id = " . session_id(); } [/code] Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted November 4, 2006 Share Posted November 4, 2006 Its session_start not start_session Quote Link to comment Share on other sites More sharing options...
Nicarlo Posted November 6, 2006 Author Share Posted November 6, 2006 ive always been using start_session and it worked before.. Why would it just stop working all of the sudden ? Quote Link to comment Share on other sites More sharing options...
Ninjakreborn Posted November 6, 2006 Share Posted November 6, 2006 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. Quote Link to comment Share on other sites More sharing options...
Nicarlo Posted November 6, 2006 Author Share Posted November 6, 2006 yeah i remember they did something to the php.ini file so that probably was it.. if i change it to session_start() would it do the same thing as the start_session() in php.ini ? Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted November 6, 2006 Share Posted November 6, 2006 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. Quote Link to comment Share on other sites More sharing options...
Ninjakreborn Posted November 6, 2006 Share Posted November 6, 2006 Yes, that was what I meant, but I never used it, I didn't know it produced a fatal error.So in essence you must have been using session_start();this whole time and not realized it until now. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.