gagan22 Posted February 24, 2009 Share Posted February 24, 2009 hi everyone, I have found one warning in my php code. How it can be removed. pls help me . It is very urgent. warning is like this on a php page......... Warning: session_start() [function.session-start]: open(/tmp/php-ses/sess_7dbaf8a556cd076ed8409da8908ea802, O_RDWR) failed: No such file or directory (2) in /home/vg002web01/12/46/1014612/web/login/user.main.php on line 2 Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/vg002web01/12/46/1014612/web/login/user.main.php:2) in /home/vg002web01/12/46/1014612/web/login/user.main.php on line 2 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/vg002web01/12/46/1014612/web/login/user.main.php:2) in /home/vg002web01/12/46/1014612/web/login/user.main.php on line 2 Warning: Cannot modify header information - headers already sent by (output started at /home/vg002web01/12/46/1014612/web/login/user.main.php:2) in /home/vg002web01/12/46/1014612/web/login/user.main.php on line 9 Pls help me. Thanks gagan Link to comment https://forums.phpfreaks.com/topic/146642-warning-session_start-in-php/ Share on other sites More sharing options...
trq Posted February 24, 2009 Share Posted February 24, 2009 session_start needs to be called prior to ANY output being sent to the browser. Link to comment https://forums.phpfreaks.com/topic/146642-warning-session_start-in-php/#findComment-769879 Share on other sites More sharing options...
Q695 Posted February 24, 2009 Share Posted February 24, 2009 I pull the session_start() from the top of the index page as the first command which works fairly well. look at the page load source code, it may have a bit handeler at the top of the page. Link to comment https://forums.phpfreaks.com/topic/146642-warning-session_start-in-php/#findComment-769889 Share on other sites More sharing options...
PFMaBiSmAd Posted February 24, 2009 Share Posted February 24, 2009 Or the error means that the folder that session.save_path is set to /tmp/php-ses/ does not exist or the session.save_path is not set to the correct folder, depending on if you are a pessimist or an optimist. Link to comment https://forums.phpfreaks.com/topic/146642-warning-session_start-in-php/#findComment-769896 Share on other sites More sharing options...
gagan22 Posted February 28, 2009 Author Share Posted February 28, 2009 Hi everyone, I am facing such type of warning is coming in php file.How it can be resolved . I have also used session_start() function in php file as a first line in php code. I have also used it (session_start() function as a first line in php code ) just prior to sending output to browser.But still warning is coming. I am so confused about this . Please help me . I am sending what type of warning is coming. But i am unable to solve this warning. Please help me. Such type of warning is coming----------- Warning: session_start() [function.session-start]: open(/tmp/php-ses/sess_7dbaf8a556cd076ed8409da8908ea802, O_RDWR) failed: No such file or directory (2) in /home/vg002web01/12/46/1014612/web/login/user.main.php on line 2 Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/vg002web01/12/46/1014612/web/login/user.main.php:2) in /home/vg002web01/12/46/1014612/web/login/user.main.php on line 2 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/vg002web01/12/46/1014612/web/login/user.main.php:2) in /home/vg002web01/12/46/1014612/web/login/user.main.php on line 2 Warning: Cannot modify header information - headers already sent by (output started at /home/vg002web01/12/46/1014612/web/login/user.main.php:2) in /home/vg002web01/12/46/1014612/web/login/user.main.php on line 9 Thanks, Gagan Link to comment https://forums.phpfreaks.com/topic/146642-warning-session_start-in-php/#findComment-773173 Share on other sites More sharing options...
waynew Posted February 28, 2009 Share Posted February 28, 2009 Could you post the code etc? Link to comment https://forums.phpfreaks.com/topic/146642-warning-session_start-in-php/#findComment-773178 Share on other sites More sharing options...
timecatcher Posted February 28, 2009 Share Posted February 28, 2009 Header errors are mostly down to a space after a heredoc, and as far as the sessions like other people have said call it at the top before anything and the best way to do this is you need it a lot is to place it in the config.php file at the top before the db information then include it in all your files. TC. Link to comment https://forums.phpfreaks.com/topic/146642-warning-session_start-in-php/#findComment-773192 Share on other sites More sharing options...
kenrbnsn Posted February 28, 2009 Share Posted February 28, 2009 The main culprit in here is the first warning message: Warning: session_start() [function.session-start]: open(/tmp/php-ses/sess_7dbaf8a556cd076ed8409da8908ea802, O_RDWR) failed: No such file or directory (2) in /home/vg002web01/12/46/1014612/web/login/user.main.php on line 2 This is telling you that the directory where PHP wants to store the session information either doesn't exist or is not writable by the web server process. The other warnings are coming out because of the first message. Fix the protection problem and the other warning should disappear. Ken Link to comment https://forums.phpfreaks.com/topic/146642-warning-session_start-in-php/#findComment-773220 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.