NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
start_session() problem


Joined: 21 Jul 2003
Posts: 14
Location: Berkeley
Reply with quote
When I run the following code inside the php IDE...

<?php

session_start();
$_SESSION['username'] = 'foob';

?>


I get the following errors:

Warning: session_start(): open(/tmp\sess_60a77f03ceca8ef77695a2370313018d, O_RDWR) failed: No such file or directory (2) in X:\ARC\__admin\noname1.php on line 3

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at X:\ARC\__admin\noname1.php:3) in X:\ARC\__admin\noname1.php on line 3

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at X:\ARC\__admin\noname1.php:3) in X:\ARC\__admin\noname1.php on line 3

Warning: Cannot modify header information - headers already sent by (output started at X:\ARC\__admin\noname1.php:3) in X:\ARC\__admin\noname1.php on line 5

Warning: Unknown(): open(/tmp\sess_60a77f03ceca8ef77695a2370313018d, 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 do you think the problem could be?

Elliot
View user's profileFind all posts by elliotonehouseSend private messageVisit poster's website


Joined: 21 Jul 2003
Posts: 14
Location: Berkeley
Reply with quote
Hi ddmitrie and gang,

I managed to figure it out! I am on a Windows machine and a line in php.ini file needed to be changed to reflect the location of the temporary directory on my machine:

The following line...

Quote:
session.save_path = /tmp


needed to be changed to...

Quote:
session.save_path = "C:\WINDOWS\Temp"


'
Elliot
View user's profileFind all posts by elliotonehouseSend private messageVisit poster's website
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
you're right.

btw, do you run php shipped with phped ?
I remember we fixed this problem. The default php.ini contains wrong setting and we have corrected it, at least should be in phped 3.2 update pack #1.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 21 Jul 2003
Posts: 14
Location: Berkeley
Reply with quote
Yup, I haven't installed the update pack yet. I have been having problems with my login, so I haven't been able to download it, but I just got an email from Jay Park stating that the problem is fixed. So, I will download and install it today.
View user's profileFind all posts by elliotonehouseSend private messageVisit poster's website
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
session_start() can't be called from a freely selected location. Take a look at the php documentation for the details.
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Re: I get the same errors


Joined: 21 Nov 2003
Posts: 39
Reply with quote
ja1clark wrote:
...
session.save_path = "C:\Program Files\nusphere\apache\logs\sessions"
and the durcetory is there.

Warning: session_start(): open(C:\Program Files\nusphere\phpED\php\sessions\sess_b662ba92968fc6f89574a6c2cb0fd27d, O_RDWR) failed: No such file or directory (2) in C:\Program Files\nusphere\apache\htdocs\Source\authorised.php on line 2
...

You are looking at the wrong php.ini because the php you are using is looking for C:\Program Files\nusphere\phpED\php\sessions (which doesn't exist), not C:\Program Files\nusphere\apache\logs\sessions (which exists)
View user's profileFind all posts by netgertSend private messageVisit poster's websiteMSN Messenger
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
if you use TechPlatform take a look at
Code:
C:\Program Files\nusphere\apache\php.ini
file

if you run SRV server you should take a look in
Code:
C:\Program Files\nusphere\phpED\php\php.ini
file.

then make sure that the directory specified as session.save_path exists.


Last edited by dmitri on Sun Jan 11, 2004 3:16 pm; edited 1 time in total
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 21 Nov 2003
Posts: 39
Reply with quote
it seems he/she is looking at TP's php.ini while actually using SRV's php.ini. so probably he/she should use TP's apache server as server or continue to use SRV and create the "sessions" folder in C:\Program Files\nusphere\phpED\php
View user's profileFind all posts by netgertSend private messageVisit poster's websiteMSN Messenger
Solved


Joined: 20 Nov 2003
Posts: 4
Reply with quote
so when I delved deeper I was looking at the wrong php.ini file - I was looking under apache and not phped. I still had to manually add the sessions directory however.

Perhaps this was caused by my confusion about the apache server - I have it installed as a service and automatically running. Is this necessary for debugging or does the debugger start up an instance by itself when invoked? Is this why there is a separate php.ini in the phped directory?
View user's profileFind all posts by ja1clarkSend private message
start_session() problem
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic