1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Session_save_path issue. Please help!

Discussion in 'PHP' started by geej, Oct 26, 2005.

  1. #1
    Why I am getting an error message when attempting to write /tmp space using PHP?

    When using the “session_start” function in a php script you may get this error:

    Warning: open(/tmp/php-es/sess_dd2b92bdf6a405f4a63ef5a9e999aded, O_RDWR) failed: No such file or directory (2) in /c3/xeno5993/phpwebsite/open_session.php on line 2

    This is because you don’t have permissions to the “/tmp” directory on the server where the php.ini specifies that sessions are stored. However, by using the “session_save_path” function you can specify where sessions are saved. Specify the path to a folder within your site for sessions to be saved, and override the setting specified in the php.ini. Below is an example:


    NOTE: It is important that the “session_save_path” function is called before the “session_start” function.

    PHP Session Path Function:
    Syntax: session_save_path('<absolute_path>');


    <?php
    session_save_path("/nfs/cust/1/21/23/632121/tmp/session");
    session_start();
    // create dir

    ?>


    Note: You should replace the "/a1/abcd6789" with the home directory for your domain. You can find this information in the Site Information section of your Control Panel. Also, please be advised that ValueWeb cannot support your custom programming or scripts


    Where the heck am I suppose to put that code? I've been programming websites for years and never had to use a server that required this crap. It's really starting to piss me off.
     
    geej, Oct 26, 2005 IP