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

Help with session_ID()

P: n/a
When I run this:

<?PHP
session_start();
echo session_id();
?>

It give me the right ouput but it also gives me a huge error message:

Warning: session_start():
open(/tmp\sess_c6782a171d1c85b13e9b9d3ff4c4a88a, O_RDWR) failed: No
such file or directory (2) in C:\Program Files\Apache
Group\Apache2\htdocs\10.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\10.1.php:2) in C:\Program Files\Apache
Group\Apache2\htdocs\10.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\10.1.php:2) in C:\Program Files\Apache
Group\Apache2\htdocs\10.1.php on line 2
c6782a171d1c85b13e9b9d3ff4c4a88a
Warning: Unknown(): open(/tmp\sess_c6782a171d1c85b13e9b9d3ff4c4a88a,
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

What am I doing wrong?

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


P: n/a
*** ja****@gmail.com wrote/escribió (7 Jan 2005 09:18:51 -0800):
Warning: session_start():
open(/tmp\sess_c6782a171d1c85b13e9b9d3ff4c4a88a, O_RDWR) failed: No
such file or directory (2) in C:\Program Files\Apache
Group\Apache2\htdocs\10.1.php on line 2


You must specify the system temporary directory if it isn't /tmp (and it
certainly isn't, because you are using Windows). Open php.ini and change
all appearances of /tmp for an existing directory such as c:\windows\temp
or whatever.
--
-- Álvaro G. Vicario - Burgos, Spain
-- Thank you for not e-mailing me your questions
--
Jul 17 '05 #2

P: n/a
i also can suggset the follwoing

first check the php.ini file as what Alvaro G Vicario wrote you may
do:

session.save_path = "C:/php/sessiondata"

secondly if you alredy have problems do the follwoing

in the first of your page use ob_start() method , and in the end of
your script use flush() method your script may be like this :

<?PHP
ob_start();
session_start();
echo session_id();
flush();
?>

actulley this way is more usfule if you use cookise , sessions or
header methods ni your scripts, becuase all these method didn't
processed correctlly if you printing or display any data befor using
them.

Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.