Re: weird behaviour of Sessions directory on MediaTemple (dv) host



ok, as i didnt receive any reply, i will answer myself, as i finally
found the solution:

my application (oscommerce) check in php (using is_dir function) the
existence of the session directory in order to work.

But PHP doesnt see '/' as the server's FS root (the actual '/' ) but
as '/var/www/vhosts/mydomain.com/tmp'

therefore, in the original settings of the server, php could not find
either '/tmp' , '/var/lib/php/session/' nor '/var/www/vhosts/
mydomain.com/tmp' as it just couldnt read from the root.

I then followed the instruction at http://kb.mediatemple.net/article.php?id=652,
and created the '/var/www/vhosts/mydomain.com/tmp' folder, but
is_dir('/var/www/vhosts/mydomain.com/tmp') was still returning false.

finally, i changed the PHP session settings back to the orginal '/tmp'
value;
is_dir('/tmp') now doesnt check the actual FS '/tmp', but '/var/www/
vhosts/mydomain.com/tmp';
but now i've created it, so it will now return TRUE.



On Nov 30, 1:48 am, inter...@xxxxxxxxx wrote:
i just migrated my Oscommerce based site from mediatemple GS plan (a
shared hosting) to a DV plan (virtual private/dedicated)

the new url is:http://72.47.210.90/
the new server installs CentOS 4.4 (more specs herehttp://kb.mediatemple.net/article.php?id=239)

the server's FS looks like this:
* drwxrwxrwx --- tmp
* ....
* drwxr-xr-x --- usr
* drwxr-xr-x --- var
o tmp
o ...
o www
+ html
+ ...
+ vhosts
# ...and so on...
+ ...
o db
o ...
o lib
and so on.....

at first, I saw the session was not working properly, and i was
getting warnings from the application (Warning: The sessions directory
does not exist)

I then tried to create TMP folders everwhere (www, vhost,
domainname.com, httpdocs ), always giving chmod 777, right owner, and
eventually changing the session.save_path accordingly, but always with
same error.

Later i did more test, and i realized the session files are actually
created in the right folder when the pages load, but:

the main problem is:
1. a new session file is created on every page reload, so the session
information are not kept between one page an another

plus, other strange details which are not creating problems directly,
but may be related:
2. is_dir() function doesnt see the session folder path
[is_dir('/var/www/vhosts/mydomain.com/tmp') returns FALSE]

3. for testing, i tried to printout the dir structure from within php:
while (false !== ($file = readdir('./'))) {
if ($file != "." && $file != "..") {
echo "$file\n";
}

}

on other servers it will return the folder content, eg:
html
cgi-bin
.htaccess

while on this server i get nothing, just like i was on the root of the
server!

mediatemple is not answering on this, and i am lost!
could anyone enlighten me?

.



Relevant Pages

  • Re: Session variables are lost, disappear from page to page
    ... MS Windows Server 2003 ... says 'edit records' and 'delete records'. ... the data in the session array is gone. ... I think it's a PHP bug, but PHP support won't acknowledge it as a bug, ...
    (comp.lang.php)
  • Re: Session variables are lost, disappear from page to page
    ... MS Windows Server 2003 ... says 'edit records' and 'delete records'. ... the data in the session array is gone. ... I think it's a PHP bug, but PHP support won't acknowledge it as a bug, ...
    (comp.lang.php)
  • Re: Simultaneous calling two PHP scripts
    ... After data received, the JavaScript ... If I have one XHR in 'wait' state (so the PHP ... subsequent communication with the server. ... you should call session_write_close() before waiting to free up the session for another request. ...
    (comp.lang.php)
  • Re: PHP/Apache or IE problem (no GPC data)
    ... not really about PHP but this is the best ... we get complaints from our customers about them losing their session. ... 20 times per 200k hits (one day's work per server). ... Still I saw http hits without any get/post/cookie data, ...
    (comp.lang.php)
  • Re: session_start() does not reload existing session
    ... Did you create the folder specific as session.save_path in php.ini? ... PHP won't create it for you and a session wouldn't be ... I run AdSubtract Pro on ... > on my laptop AdSubtract was consuming the cookies php was issuing. ...
    (comp.lang.php)