Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

PHP session headers error

header session

  • Please log in to reply
10 replies to this topic

#1 JakeWelton

JakeWelton

    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 152 posts
  • Programming Language:Java, C++, C#, PHP, JavaScript, PL/SQL
  • Learning:Objective-C, Python, Perl, Ruby, Visual Basic .NET, Haskell

Posted 12 March 2011 - 11:29 AM

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
  • 0

#2 WingedPanther73

WingedPanther73

    A spammer's worst nightmare

  • Moderator
  • 17757 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

Posted 12 March 2011 - 12:20 PM

What's BEFORE the lines you showed us?
  • 0

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/


#3 JakeWelton

JakeWelton

    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 152 posts
  • Programming Language:Java, C++, C#, PHP, JavaScript, PL/SQL
  • Learning:Objective-C, Python, Perl, Ruby, Visual Basic .NET, Haskell

Posted 12 March 2011 - 02:19 PM

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

#4 Alexander

Alexander

    YOL9

  • Moderator
  • 3963 posts
  • Location:Vancouver, Eh! Cleverness: 200
  • Programming Language:C, C++, PHP, Assembly

Posted 12 March 2011 - 02:34 PM

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
  • 0

All new problems require investigation, and so if errors are problems, try to learn as much as you can and report back.


#5 JakeWelton

JakeWelton

    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 152 posts
  • Programming Language:Java, C++, C#, PHP, JavaScript, PL/SQL
  • Learning:Objective-C, Python, Perl, Ruby, Visual Basic .NET, Haskell

Posted 12 March 2011 - 03:00 PM

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
  • 0

#6 Alexander

Alexander

    YOL9

  • Moderator
  • 3963 posts
  • Location:Vancouver, Eh! Cleverness: 200
  • Programming Language:C, C++, PHP, Assembly

Posted 12 March 2011 - 03:07 PM

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

All new problems require investigation, and so if errors are problems, try to learn as much as you can and report back.


#7 JakeWelton

JakeWelton

    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 152 posts
  • Programming Language:Java, C++, C#, PHP, JavaScript, PL/SQL
  • Learning:Objective-C, Python, Perl, Ruby, Visual Basic .NET, Haskell

Posted 12 March 2011 - 03:19 PM

hmmm im not sure tbh, is there anything i can do?
  • 0

#8 WingedPanther73

WingedPanther73

    A spammer's worst nightmare

  • Moderator
  • 17757 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

Posted 13 March 2011 - 04:24 AM

Is this file being included by another file that sends something?
  • 0

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/


#9 JakeWelton

JakeWelton

    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 152 posts
  • Programming Language:Java, C++, C#, PHP, JavaScript, PL/SQL
  • Learning:Objective-C, Python, Perl, Ruby, Visual Basic .NET, Haskell

Posted 13 March 2011 - 04:28 AM

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?
  • 0

#10 Upstream

Upstream

    CC Resident

  • Advanced Member
  • PipPipPipPip
  • 98 posts
  • Location:Netherlands
  • Programming Language:C, C++, PHP, (Visual) Basic, JavaScript, Perl, Bash, Others
  • Learning:Others

Posted 14 March 2011 - 04:56 PM

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

#11 Bioshox

Bioshox

    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 210 posts

Posted 16 March 2011 - 02:39 AM

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

Contact your host.
  • 0





Also tagged with one or more of these keywords: header, session

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download