views:

150

answers:

2

i have a problem with my session files...

if i go to my site directly (www.example.com) then php session files owner is www-data:www-data but if i go do the site via www.example.com/index.php then the owner of the session files is ftp:www-data and the resulting problem is when i want to start the session but the session file allready exists but having a different owner php can not open the session file for writing.

i'm running apache + php5

A: 

By chance are there two (instances) servers running on port 80? I don't know how else to explain the difference in ownership (unless your script is somehow explicitly changing the ownership).

I suggest removing all session data, and watching them get created one by one. Try it with additional files as well. If they ping-pong (one by ftp, one by www-data, one by ftp, one by www-data, ...) then I would lean toward two servers running.

You're not by chance behind a load balancer are you?

ChronoFish
The permissions of any file you write should match the permission of the session files. Just an FYI to help in your debugging.
ChronoFish
i have found the solution for this problem... i will post it soon, but this was not the correct answer...and i'm not behind a load balancer :)
Gabriel
I'm anxious to hear what the root problem was.
ChronoFish
A: 

So the problem was with who the owner of index.php was and all php files. All php files should have had the owner www-data:www-data... but a small fraction of files was uploaded via ftp and so the owner was ftp:www-data.

And the session file had the same owner as the php file where the session was started... don't know if this is spessific only to my server.

Gabriel