Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 429
  • Last Modified:

php unable to create sessions on apache windows

Warning: session_start() [function.session-start]: open(/tmp\sess_8d89bcaa20f440c9dd97be163596948a, O_RDWR) failed: No such file or directory (2) in C:\Program Files\Apache Group\Apache2\htdocs\scheduler\login.php on line 8

This is on an Apache 2.0.44(win32) server with php 4.3.1

I have changed:

session.save_path = c:\winnt\temp  (the windows temp directory as suggested in the documentation) and this directory does exist.

The fact that the error is generating "open(/tmp\sess" leads me to believe that the session save directory is still mapped wrong somewhere but i cannot find any other places to change it.

  • 3
  • 2
1 Solution
don't you see you've a problem of slashes ? (/tmp\sess_8...)

You're on Windows and your [session] section of php.ini was not modified correctly. Look into it.
Change the directory for sessions files repository :
this is not correct

put D:\TMP or whatever suits you


; Handler used to store/retrieve data.
session.save_handler = files

; Argument passed to save_handler.  In the case of files, this is the path
; where data files are stored. Note: Windows users have to change this
; variable in order to use PHP's session functions.
;VGR27092002 CHANGEMENT !!!
;VGR01102002 NTFS ou FAT32 requis pour atime() ?
session.save_path = G:\php_sess\

AnexkahnAuthor Commented:
Right, i see it is a problem of slashes, but i can't figure out where its comming up with the /tmp refrence.

I have modified php.ini and also searched the entire file for any other refrences to /tmp and cant find anything.

session.save_handler = files
session.save_path = C:\winnt\temp
session.name = PHPSESSID
session.cookie_lifetime = 0
session.cookie_path = \
session.cookie_domain =
session.serialize_handler = php
session.gc_probability = 1
session.gc_dividend    = 100
session.gc_maxlifetime = 1440
session.bug_compat_42 = 1
session.bug_compat_warn = 1
session.referer_check =
session.entropy_file =
;session.entropy_length = 16
;session.entropy_file = /dev/urandom
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0

easy 8-) (may-be)

Let's suppose you had TWO (or more) php.ini files on your computer ? :D
AnexkahnAuthor Commented:
Ahh, not quite, but it did point me in the right direction.  Somehow the installsheild installer placed the php.ini file in the user directory and not in the windows system directory.

thanks vgr!

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now