473,498 Members | 1,911 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

session_start(): ps_files_cleanup_dir

111 New Member
HI, i'm getting this error on my PHP scripts, but the weird thing is that it only appears sometimes

the exact error is:
Notice: session_start() [function.session-start]: ps_files_cleanup_dir: opendir(C:\WINDOWS\TEMP\) failed: No such file or directory

it says it appears on line 28,
line 28 only contains a
[PHP]session_start()[/PHP]
and no other code is near this line.

the funny thing is that it only appears occasionly.
If I refresh the page, the error goes away and sometimes it comes back.

i've been doing some searcing on google for this, but all i could find was that there is an error in PHP that causes this to happen on Debain operating system.


my website is running on IIS 6.0 on windows server 2003 (i'm using PHP 5), and there doesn't seem to be any mention of this bug in a windows environment.

Anyone have any idea on how i can fix this?, or why it is happening?
Jan 24 '08 #1
5 17653
harshmaul
490 Recognized Expert Contributor
session start has to be the absolute first line of php in the page. before any headers are sent,
line sone should be ... session_start();
Jan 25 '08 #2
nitinpatel1117
111 New Member
Hi Harshmaul
I am not sending any headers, or outputing anything onto the screen before the session_start(), so i'm pretty sure its not related to that.

also if it was related to that, then the error should always appear.
but my error only appears occasionaly.


I think it may have something to do with the 'garbage collector' removing my session file, or something along those lines. which would mean that i need to configure my php.ini

also, i've just installed php on this server, meaning that the chances that php.ini needs configuring are even greater, so i'm pretty sure its something to do with php.ini, but i've got no idea what needs to be set and to what.

any help on this would be greatly appreciated.
Jan 25 '08 #3
nitinpatel1117
111 New Member
settings in my php.ini are as follows:

session.gc_maxlifetime = 1440
session.gc_probability = 1
session.gc_divisor = 100


session.gc_divisor was origionally set to 1000, but i changed it to 100 to see it this makes any difference, although this would probably increase the probability of the garbage collector being started.

the above max life is 1440 which is 24 minutes, which is definilty within the time frame of my script, so i think that is not the problem.


Anyone?
Jan 25 '08 #4
Atli
5,058 Recognized Expert Expert
Hi.

Is this having any effect on how your code is executing?
Is you code behaving abnormally when this notice is shown?

If not you could simply block it.
Expand|Select|Wrap|Line Numbers
  1. @session_start();
  2.  
This should silence the notice.
But if you choose to do this I would keep an eye out for weird session behavior.
Jan 25 '08 #5
rohypnol
54 New Member
From what I've seen in other places, the problem is with permissions... PHP might not have enough rights to work with that folder.

Regarding what harshmaul said, I'm pretty sure that the call session_start() is OK, as I've had this error before, too. The second error message ("headers already sent") shows up because you're trying to send headers after the output has already started. You may have not done it yourself, but the first error message popping up has done it for you.

Maybe this helps, read both pages before taking action:
http://www.tek-tips.com/viewthread.cfm?qid=805632
http://bugs.php.net/bug.php?id=20720&edit=1

DON'T do like I did, which was to give PHP the same rights as root. That was the worst decision I've taken in the past 30 years. That will only make your whole system vulnerable to everyone out there...

Suppressing the error message with an @ should be fine for the moment but there are long-term side-effects, I am not aware of them, but I'm sure there are.

Hope this helps, it took me quite a while to realize what's happening and I was surprised that there wasn't a complete answer on bytes.com
Apr 1 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
2890
by: Florence HENRY | last post by:
Hello, I've searched about my problem on google before posting, but I didn't find anything relevant... I have a problem with session_start. Here is my code : <html> <head> <?php...
19
11122
by: Chris Allen | last post by:
Hi I'm new to PHP and I'm trying to create a Login Form. Once the user has logged in then he shouldn't have to log in again. The trouble is I'm getting a new session ID between every page and so...
2
1915
by: Reply-Via-Newsgroup Thanks | last post by:
Folks, I consider myself a reasonably strong PHP programmer, but I've not used sessions before (I've used cookies instead) and I'd appreciate it if someone could confirm something for me. ...
4
14064
by: Bob | last post by:
Seem to have a problem ending a session. I get the following message. Warning: session_start(): Cannot send session cookie - headers already sent by (output started at...
3
2197
by: Trogdor | last post by:
I set up a server on an AMD 650 machine running gentoo linux. I installed Apachie 2, MySQL 4.1 and PHP 4.3.11 I use another computer on my local net (192.168.0.x) to access the server as a...
1
8907
by: Mercy | last post by:
Hi, I'm a newbie. I was trying to figure out how to use the Session_start method? The reference books I'm reading say that a session STARTS when "session_start" is called. But ... in their sample...
8
2223
by: lkrubner | last post by:
I was trying to set a cookie before I called session_start() and it was giving me an error. But isn't sessions really just a cookie? Why would it matter if I sent a cookie before session_start? Can...
5
2158
by: Niklas Uhlin | last post by:
Someone please explain why Session_Start fires multiple times / retains SessionID values between sessions, when you open an ASP.NET page from MS Word. For details of the problem, see below: 1....
19
7899
by: lawrence k | last post by:
How can I find out where my script is outputting to the screen for the first time? My error logs are full of stuff like this: PHP Warning: session_start(): Cannot send session cache...
0
7125
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7002
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7165
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6885
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5462
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4908
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3093
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1417
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
290
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.