Php session files have different owners
i ha开发者_运维技巧ve 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
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?
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.
精彩评论