By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,506 Members | 1,876 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,506 IT Pros & Developers. It's quick & easy.

problem with session_start()

P: n/a
when I use the session_start() function at the top of my scripts I get
5 errors on the page
If anyone can help please do this has been a problem for a while and I
cannot do much more work on my site without fixing this and getting the
login system to work

Here are the errors:

At the TOP of the page I get the following three errors,

Warning: session_start(): open(\sessiondata\sess_***, O_RDWR) failed:
No such file or directory (2) in \header.php on line 2
Warning: session_start(): Cannot send session cookie - headers already
sent by (output started at \header.php:2) in \header.php on line 2

Warning: session_start(): Cannot send session cache limiter - headers
already sent (output started at \header.php:2) in \header.php on line 2

At the BOTTOM of the page I get two other errors,

Warning: Unknown(): open(\sessiondata\sess_***, 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 (\sessiondata)
in Unknown on line 0

Jul 17 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
On 16 Apr 2005 08:16:15 -0700, "co********@gmail.com" <co********@gmail.com>
wrote:
when I use the session_start() function at the top of my scripts I get
5 errors on the page
If anyone can help please do this has been a problem for a while and I
cannot do much more work on my site without fixing this and getting the
login system to work

Here are the errors:

At the TOP of the page I get the following three errors,

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


That's the key - your session.save_path is wrong. All the errors stem from PHP
not being able to write session data to where you've specified.

What operating system are you on? If Unix-based, the slash is the wrong way
around. If Windows-based you haven't got a drive letter so it might be looking
on the wrong drive.

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #2

P: n/a
I know the last error says to check the seesion.save_path variable, I
did and its set to the right spot so I'm not sure what the problem is

Jul 17 '05 #3

P: n/a
I'm on windows XP and I've checked the path its C:\PHP\sessiondata, I'm
going to double check it and make sure the folder exists now..

Jul 17 '05 #4

P: n/a
On 16 Apr 2005 08:23:38 -0700, "co********@gmail.com" <co********@gmail.com>
wrote:
I'm on windows XP and I've checked the path its C:\PHP\sessiondata, I'm
going to double check it and make sure the folder exists now..


That's not what PHP is seeing though; you might want to reverse the slashes to
c:/PHP/sessiondata, or add some quotes around it, or double up the \'s -
Window's use of \ for a directory separate clashes nastily with \ as an escape
character - but all the Windows system calls will accept Unix-style '/' as a
separator as well.

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #5

P: n/a
Ok, the problem was that my c:\php\sessiondata folder just didn't
exist... i created it and it seems to be working, thanks for your help!

Jul 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.