/    Sign up×
Community /Pin to ProfileBookmark

Failed to access session file

I have a problem getting php to create sessions. This is what I get:

Warning: session_start() [function.session-start]: open(var/www2/temp/sess_63596b3c981937e00b96990fda83a90e, O_RDWR) failed: No such file or directory (2) in /var/www2/html/login.php on line 1

It fails to create the session.

The tmp directory is set to 777. login.php should’ve access to it.

That’s the dir in php.ini. What’s going on?

I examined the directory, and the session sess_63596b3c981937e00b96990fda83a90e is there. Thing is I see -rw—– in permissions.

Could that be the problem? If so, how do I fix it?


_________________________________________________________________

[url]http://www.cttemplates.com[/url]

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@rpcarnellauthorApr 18.2008 — Okay, I figured this one out:

The directory /tmp in Linux has the setting drwxrwxrwt. Notice the t at the end.

This is what the other directories were lacking.

Where the t means "sticky". This is to allow session files to be read, written, and deleted only by the software that created them. That's why session wasn't working in the other directory.
×

Success!

Help @rpcarnell spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.24,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...