Jump to content

PHP session headers error

- - - - -

  • Please log in to reply
10 replies to this topic

#1
welton122

welton122

    Learning Programmer

  • Members
  • PipPipPip
  • 76 posts
hi all,

okay i have a problem. I keep on getting errors refering to header errrors. I know that when using sessions you have to send the "session_start();" command before anything else but i still have a problem.

This problem has got so annoying that i stripped all my code out of the page and just left in this:

<?php 

session_start();

?>

These are the errors i am getting:

Warning: session_start() [function.session-start]: open(/var/chroot/home/content/46/7480346/tmp/sess_c86d29duakfbej19mjb0quvu13, O_RDWR) failed: No such file or directory (2) in /home/content/46/7480346/html/login_process.php on line 2


Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/46/7480346/html/login_process.php:2) in /home/content/46/7480346/html/login_process.php on line 2


Warning: Unknown: open(/var/chroot/home/content/46/7480346/tmp/sess_c86d29duakfbej19mjb0quvu13, O_RDWR) failed: No such file or directory (2) in Unknown on line 0


Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct () in Unknown on line 0

Can anyone help me please?

Thanks,
Jake

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
What's BEFORE the lines you showed us?
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
welton122

welton122

    Learning Programmer

  • Members
  • PipPipPip
  • 76 posts
theres nothing, thats where my problem is. Nothing is being sent to the browser before this code as this code is all that is on the page.

#4
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,124 posts
  • Location:Vancouver, Eh! Cleverness: 200
If you could write to session before:
Can you verify with a hex editor that no content is before the opening tag? The opening tag will be 3C 3F 70 68 70
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#5
welton122

welton122

    Learning Programmer

  • Members
  • PipPipPip
  • 76 posts
The image has been attached already, i will put it else where if you cannot access. One moment.

EDIT: heres the image again, hosted by ImageShack

Posted Image

URL: http://img571.images...36/56567816.jpg

#6
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,124 posts
  • Location:Vancouver, Eh! Cleverness: 200
It seems there is no byte order mark. Did something change in your system? The other warning seems to state that you cannot write to the temporary location.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#7
welton122

welton122

    Learning Programmer

  • Members
  • PipPipPip
  • 76 posts
hmmm im not sure tbh, is there anything i can do?

#8
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
Is this file being included by another file that sends something?
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#9
welton122

welton122

    Learning Programmer

  • Members
  • PipPipPip
  • 76 posts
no, maybe it will help if i explain what the file is used for. First of the page i am having problems with is page B. I have a login form on page A, when the user submits the form, the data is sent to page B, page B then checks to see if the user name and password is correct and then sets a session if it is. I know nothing on page B is being sent before the session start, but could page A have any effects?

#10
Upstream

Upstream

    Learning Programmer

  • Members
  • PipPipPip
  • 44 posts
I think that you have a config problem. In php.ini session.save_path must point to a writeable folder.

#11
Bioshox

Bioshox

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 207 posts
I had something similar to this on my server with sessionstart, maybe it's something to do with the PHP config.

Contact your host.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users