SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Wizard xyuri's Avatar
    Join Date
    Jul 2002
    Location
    Brisbane
    Posts
    1,487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Session and PHP setup issue.

    I have recently reinstalled all mt web service appliactions, thus renewing my PHP installation. I have been working on a forum script for a while and just copied the code back into the wwwroot; I also copied over my old PHP.INI which has all the settings the way i want it. but for some reason it doesnt like sessions anymore, and gives the following error when i try and run my forum code:

    Warning: open(/sessiondata\sess_71a8af9d0d2695afd4d4500958e52f56, O_RDWR) failed: No such file or directory (2) in c:\program files\apache group\apache\htdocs\forum\index.php on line 3

    which is reads:

    session_start();

    hmmm, what could be wrong, and in case anyone asks, the whole code for index.php is as follows:

    PHP Code:
    <?PHP
    session_name
    ("xyuri");
    session_start();
    ?>

    <html>
    <head>
    </head>
    <link rel="stylesheet" type="text/css" href="main.css">
    <body>

    <?PHP
    Error_reporting
    (E_ALL);
    Require (
    'config.inc.php');
    Require (
    'init.inc.php');
    Require (
    'user_init.inc.php');
    // Get site variables and settings here!

    IF (!isset($_GET['page'])) {$_GET['page'] = 'home';}
    ?>

    <?PHP
    Require ('header.php');

    SWITCH (
    $_GET['page'])
        {
        case 
    'home':  require('home.php'); break;
        case 
    'viewforum':  require('viewforum.php'); break;
        case 
    'viewthread':  require('viewthread.php'); break;
        case 
    'newthread':  require('newthread.php'); break;
        case 
    'postreply':  require('postreply.php'); break;
        }
    ?>

    </body>
    </html>
    can anyone help me with this?? i would be quite gratefull

  2. #2
    SitePoint Zealot
    Join Date
    Oct 2001
    Location
    London, UK.
    Posts
    103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sounds to me like something in the php.ini file isn't correct.
    Check that the folder you are trying to store sessions in is present on your system and that everyone has access to write/read to/from it.
    It looks like it is trying to write to /sessiondata
    Most windows systems can be setup by changeing the line:

    session.save_path = /tmp

    To (Change WINDOWS_FOLDER to your correct path):

    session.save_path = WINDOWS_FOLDER/TEMP

    Otherwise it may just be a case of setting up the folder sessiondata somewhere on your computer.

    Hope this is of help

    David
    Do you fear the obselescence of the
    metanarrative apparatus of legitimation?

  3. #3
    SitePoint Wizard xyuri's Avatar
    Join Date
    Jul 2002
    Location
    Brisbane
    Posts
    1,487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, I changed that value to as follows:

    session.save_path=C:\PHP\sessiondata

    but the page isnt displaying anytyhing this time, which means that it hasnt gone to check that its not connecting to the database I'll check my Apache settings.

  4. #4
    SitePoint Wizard xyuri's Avatar
    Join Date
    Jul 2002
    Location
    Brisbane
    Posts
    1,487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, my apache settings for the docroot are as follows:

    Code:
    <Directory "C:/Program Files/Apache Group/Apache/htdocs">
    
    #
    # This may also be "None", "All", or any combination of "Indexes",
    # "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
        #Options Indexes FollowSymLinks MultiViews
        Options All
    
    #
    # This controls which options the .htaccess files in directories can
    # override. Can also be "All", or any combination of "Options", "FileInfo", 
    # "AuthConfig", and "Limit"
    #
        AllowOverride all
    
    #
    # Controls who can get stuff from this server.
    #
        Order allow,deny
        Allow from all
    </Directory>
    what could be wrong ?

  5. #5
    SitePoint Zealot
    Join Date
    Oct 2001
    Location
    London, UK.
    Posts
    103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try using forward slashes:

    session.save_path = C:/PHP/sessiondata

    And there needs to be a space between session.save_path and the =
    Likewise the othe side too

    David
    Do you fear the obselescence of the
    metanarrative apparatus of legitimation?

  6. #6
    SitePoint Wizard xyuri's Avatar
    Join Date
    Jul 2002
    Location
    Brisbane
    Posts
    1,487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Still doesnt work. and spaces between the variable and value doesnt matter

    I'm just getting a blank page, I'll write some scripts in a couple od hours that should probably tell exactly what the problem is being caused by.

  7. #7
    SitePoint Wizard xyuri's Avatar
    Join Date
    Jul 2002
    Location
    Brisbane
    Posts
    1,487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, panic is over, I got the page working For some reason it was being silly untill I checked that the database was working, I repopulated the default database layout and, magic, it works

    Thanks you guys for all the help


Bookmarks

Posting Permissions

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