function.session-start warnings...

Hi!

Recently I installed dolibarr on my website which is hosted by godaddy and is on a shared server…

There was issues with my server so they moved me over to a new one and since then I’ve had tons of issues with dolibarr. I reinstalled everything but I cant get rid of the following errors

Warning: session_start() [function.session-start]: open(/var/chroot/home/content/88/3724188/tmp/sess_s95nvtiid2rao09agai5tin173, O_RDWR) failed: No such file or directory (2) in /home/content/88/3724188/html/open/main.inc.php on line 166

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/content/88/3724188/html/open/main.inc.php:166) in /home/content/88/3724188/html/open/main.inc.php on line 166

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/88/3724188/html/open/main.inc.php:166) in /home/content/88/3724188/html/open/main.inc.php on line 166

Warning: Cannot modify header information - headers already sent by (output started at /home/content/88/3724188/html/open/main.inc.php:166) in /home/content/88/3724188/html/open/index.php on line 49

Warning: Unknown: open(/var/chroot/home/content/88/3724188/tmp/sess_s95nvtiid2rao09agai5tin173, O_RDWR) failed: No such file or directory (2) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct () in Unknown on line 0

now if I comment out line 161 to 174 in main.inc.php all the issues stop but the following code which i temporarily omitted

// Init session. Name of session is specific to Dolibarr instance.
$prefix=dol_getprefix();
$sessionname=‘DOLSESSID_’.$prefix;
$sessiontimeout=‘DOLSESSTIMEOUT_’.$prefix;
if (! empty($_COOKIE[$sessiontimeout])) ini_set(‘session.gc_maxlifetime’,$_COOKIE[$sessiontimeout]);
session_name($sessionname);
session_start();
if (ini_get(‘register_globals’)) // To solve bug in using $_SESSION
{
foreach ($_SESSION as $key=>$value)
{
if (isset($GLOBALS[$key])) unset($GLOBALS[$key]);
}
}

controls the session and without it after every action in dolibarr i have to re login…

could the above issues have anything to do with my dns a records? the only reason i ask is because when i was moved to the new servers i noticed I had no tmp and temp in my A (host) records which i had before…

Thanks in advance!!!

Hopefully someone corrects me if I’m wrong but from what I can tell Dolibarr is trying to create a temporary file in /var/chroot/home/content/88/3724188/tmp

however my full file root is

/var/chroot/home/content/88/3724188/html/open

so the tmp folder is above my actual file root…

Is that correct??

if so is there anyway I can change where this temporary file is created? like

/var/chroot/home/content/88/3724188/html/open/tmpcookie/

or something like that?

After trolling through the forms i found one that had login issues… Eldy described issues with php and session.save_

so create a file called php5.ini and put this in it

session.save_path= /tmp

save and upload to your doc root

if you cant get into dolibarr to find out what you php says omit line 166 in main.inc.php (the session_start line)

this will make you relogin 30 times once in dolibarr but at least your in to start figuring things out

The problem does not look to be into Dolibarr but into PHP setup.
PHP need to store session data into files to work.
Ask your web hosting provider to check that PHP setup for your instance is correct (Dir /var/chroot/home/content/88/3724188/tmp/ must exists and must be writable by the web server). If your PHP fails to write into this directory, it is not (setup of dir may be wrong into php.ini of permission may be wrong into directory).

Yeah I figured that out late last night… such a simple problem gave me huge headaches…

Is it possible in future releases to have the system check that prior or during install?

don’t get me wrong its a really easy fix once you know why its doing it but it took me hours to figure out why it was happening

btw I use godaddy asking them to do anything is like getting a toddler to perform brain surgery - - for anyone who ever has a session problem or if dolibarr makes you log in after every action just follow the directions listed a couple of post ago

Oh yeah great job with dolibarr eldy