Page 1 of 1

User Sessions Problem

Posted: Wed Mar 24, 2004 4:45 pm
by NotOnUrNelly
Hi All

I am currently working through a basic on PHP, I have typed the following code to start a user session. Once the program has run in the browser I get an error on my page. (error below code)

<?php
session_start();
?>
<html>
<head>
<title>Listing 16.1 Starting or resuming a session</title>
</head>
<body>
<?php
print "<p>Your session ID is ".session_id()."</p>\n\n";
?>
</body>
</html>

************ERROr********************************

Warning: session_start(): open(/tmp\sess_3149f8c4a854134bd5c98b3a567e81fa, O_RDWR) failed: No such file or directory (2) in C:\Program Files\Apache Group\Apache2\htdocs\hour16\listing16.1.php on line 2

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at C:\Program Files\Apache Group\Apache2\htdocs\hour16\listing16.1.php:2) in C:\Program Files\Apache Group\Apache2\htdocs\hour16\listing16.1.php on line 2

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at C:\Program Files\Apache Group\Apache2\htdocs\hour16\listing16.1.php:2) in C:\Program Files\Apache Group\Apache2\htdocs\hour16\listing16.1.php on line 2

Your session ID is 3149f8c4a854134bd5c98b3a567e81fa


Warning: Unknown(): open(/tmp\sess_3149f8c4a854134bd5c98b3a567e81fa, 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 (/tmp) in Unknown on line 0


********************************************************
As you can see the code has run partly and given me a session ID

I just do not understand why the error is occuring

Can anyone help

Many Thanks
Jamie

Posted: Wed Mar 24, 2004 4:50 pm
by markl999
Edit c:\windows\php.ini and change session.save_path from /tmp to something like c:\temp (or some other temp dir that exists).
Then restart apache.

Posted: Wed Mar 24, 2004 5:10 pm
by d3ad1ysp0rk
and make sure c:\temp exists..

I didnt have to edit the php config, only create a new folder in c:\ called "tmp" to get mine working..