Warning: session_start(): open

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Khairul Alam
Forum Newbie
Posts: 12
Joined: Tue Sep 09, 2003 6:27 am

Warning: session_start(): open

Post by Khairul Alam »

Warning: session_start(): open(/tmp\sess_46bbac00dab18999a67957a65c2455c1, O_RDWR) failed: No such file or directory (2) in c:\inetpub\wwwroot\test\session1.php on line 2

Warning: Unknown(): open(C:/inetpub/wwwroot/tmp\sess_46bbac00dab18999a67957a65c2455c1, 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 (N;C:/inetpub/wwwroot/tmp) in Unknown on line 0


Have you ever gotten that type of error ?
Could any one help me to solve this problem ?

For ur kind information.
I am using PHP-MySQL in Windows platform & IIS server.

-------- session1.php--------

Code: Select all

//---------- top of the page
<?php

session_start();

?>

<html>
<body>

<?php


if(!empty($_POST['loginid']))
{
	if(!session_is_registered('login'))
	{
	$login=$_POST['loginid'];
	session_register('login');
	print "Welcome " . $_SESSION['login'] . ". You are logged in.";

	}
}

?>

</body>
</html>
?>
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

I have moved this from the Advanced Theory and Design forum as it is a coding problem. Please read the forum descriptions before posting.

Here are a few threads in which the poster had the same problem as you and it was solved:
viewtopic.php?t=8168
viewtopic.php?t=10938
viewtopic.php?t=9241
viewtopic.php?t=8497

Mac
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

Short answer:
'C:/inetpub/wwwroot/tmp' (the directory) is probably missing. ;)
User avatar
delorian
Forum Contributor
Posts: 223
Joined: Sun May 04, 2003 5:20 pm
Location: Olsztyn, Poland

Post by delorian »

Even more short answer:
'C:/tmp' (the directory) is missing for sure. ;)

I've got the same errors once. First try to create the c:/tmp dir and then the other dir.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Or, as shown in the links I posted, edit your php.ini so that you can have your session data saved to any folder you like, e.g. c:\php\session_stuff.

It doesn't have to go to the default location.

Mac
Khairul Alam
Forum Newbie
Posts: 12
Joined: Tue Sep 09, 2003 6:27 am

Post by Khairul Alam »

thanx all for ur reply

I fixed up my problem :lol:
Post Reply