Jump to content

Warning: session_start() in PHP


gagan22

Recommended Posts

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

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

 

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.

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.