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 used it 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

Make sure there are no spaces or new lines before the php opening tag <?
Sometimes there may be something before that opening tag that outputs to the browser which is causing that error.

yes sir i am sure that there is no space or no line before <? tag .

I have done every effort to remove this .but still warning is coming.pls help me how i can solve this.

Thanks for reply,
Gagan

I remember reading a long time ago that some editors append their own invisible text before and after the text file. So have you tried using notepad to check this.

Hi sir,

If i write this <? session_starti();?> line in comments then this warning is not coming.

But i think this is not right solution for this.
and i am unable to understand this notepad concepts which you are saying this. So please tell me briefly. How i can solve this.

Thanks for reply,
gagan

Well in some editors, there may be a binary string or something like 10011010 at the beginning of the file which the program uses as some sort of identity but can cause errors when using the file on the server. But notepad is a program that you can check if this is the case because you will actually see the binary data at the beginning as converted symbols. Is that description ok?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.