Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 11 of 11
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    Montreal, Canada
    Posts
    644
    Thanks
    0
    Thanked 0 Times in 0 Posts

    can't create a session

    I set up a simple script that contained:

    PHP Code:
    <?php
    session_start
    ();
    ?>
    And I get the following error:

    Code:
    Warning: open(/tmp\sess_09c2efaf81f7bbfdc44cbb876c0ad4b3, O_RDWR) failed: No such file or directory (2) in c:\fireserv\www\sessions\sess_start.php on line 2
    
    Warning: open(/tmp\sess_09c2efaf81f7bbfdc44cbb876c0ad4b3, O_RDWR) failed: No such file or directory (2) in Unknown on line 0
    
    Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0
    In my php.ini I have:

    session.save_path = c:\WINNT\Temp

    This path does exist. Can anyone tell me why I'm getting an error?

  • #2
    Regular Coder
    Join Date
    Feb 2003
    Location
    California
    Posts
    925
    Thanks
    0
    Thanked 0 Times in 0 Posts
    did you call session_name() before you start?

    here is the call in the php page.
    http://www.php.net/manual/en/function.session-start.php
    you might want to read the notes below there too.


    Jason

  • #3
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,278
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Have you tried creating your own temp directory verses using the same temp directory your O/S is using? Create a temp directory one directory up from your web root directory(in other words a non-web-accessible directory) and see if it works.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    Montreal, Canada
    Posts
    644
    Thanks
    0
    Thanked 0 Times in 0 Posts
    tried a web-accessible and one right above the root. Neither worked.

  • #5
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,073
    Thanks
    11
    Thanked 98 Times in 96 Posts
    you got XP ?

    if so create a C:/tmp directory , XP seems to ignore the sesion_save_path sometimes ?
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #6
    Regular Coder
    Join Date
    Jun 2002
    Location
    Montreal, Canada
    Posts
    644
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That was the prob. Thanks a lot.

    I'm running win2k server.

  • #7
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,073
    Thanks
    11
    Thanked 98 Times in 96 Posts
    2K! , ok - I only ever seen it happen on XP before but interesting to know.
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #8
    New Coder
    Join Date
    Jan 2003
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts
    In the php.ini file, in the comment above the session.save_path setting for sessions says:

    ; 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.
    session.save_path = C:\PHP\tmp\

    By default, this is empty. When I tried to use sessions, i got the same error, but they ceased as soon as i set this setting. It would appear necessary for ALL versions of windows
    <?XML version="1.0" standalone="Yes" encoding="utf-8"?>
    <SIGNITURE>
    XML is the future - embrace it
    </SIGNITURE>

  • #9
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,073
    Thanks
    11
    Thanked 98 Times in 96 Posts
    optimism_ , its true you have to set this in the php.ini however for some reason with PHP on windows XP (& only sometimes ?) this path is ignored and only C:\tmp will actually work

    I had never seen this behaviour on win2k b4 though.
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #10
    Regular Coder
    Join Date
    Jun 2002
    Location
    Montreal, Canada
    Posts
    644
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Lucky me.

  • #11
    New Coder
    Join Date
    Jan 2003
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I [i]am[/] running windows XP, and have set the temp dir to a subdir of my web root on a D: partition, i can see the session files so i know it is saving to this location - It didnt work before this setting was changed though - maybe its a very obscure bug

    (running php 4.2.3 on winxphome with KFWS)
    <?XML version="1.0" standalone="Yes" encoding="utf-8"?>
    <SIGNITURE>
    XML is the future - embrace it
    </SIGNITURE>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •