Session fails to initialize (permission denied)

software development

#1

anybody know why i would be getting this error:

Warning: session_start() [function.session-start]: open(/tmp/sess_884400c24eadd439cd667b74777cfef2, O_RDWR) failed: Permission denied (13) in /…/index.php on line 4

when I call session_start() at the beginning of my page?

then at the end of the page i get…

[b]Warning: Unknown: open(/tmp/sess_884400c24eadd439cd667b74777cfef2, O_RDWR) failed: Permission denied (13) 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 (/tmp) in Unknown on line 0[/b]

I’ve been using sessions for years and this has never happened before to me. :stuck_out_tongue:

Indefinetely under construction - Plaid Screen Studios - www.plaidscreen.com


#2

It’s a dreamhost thing. You have to set the session.save_path. It defaults to /tmp, you need to put a file to log sessions in your user root (above your web root for security…ie in /user/ not /user/yourdomain.com/)

================================
Angela Gann
CrimsonDryad Web Design Services
Web Design, Custom Software Development
http://www.crimsondryad.com


#3

my site has session.save_path set to /tmp, and it works fine. the only time it didn’t was when i tried to switch it to php5 one directory at a time – php4 was running as an apache module and thus created/accessed the session file as dhapache, where php5 running as cgi would create/access session files as my user. whichever user created the session file was the only one able to access it, and the other would get an error.

needless to say i sped up moving the entire site to php5 :slight_smile:

track7 - my dream-hosted site


#4

Dreamhost is overall pretty good, but now and again their implementation of things can make it tough to figure stuff out.

I’ve been on PHP5 for over a year now, and I never ran PHP4 as an Apache module on DH, but what you’re saying about running sessions as the user vs as Apache makes sense.

I’m glad you figured out what you’ve got to do though. :slight_smile:

================================
Angela Gann
CrimsonDryad Web Design Services
Web Design, Custom Software Development
http://www.crimsondryad.com


#5

well thats what i thought the problem was, so i originally switched my path to inside my user directory…but i was still getting the error after the session had been created and then on another page needed to be accessed. nothing i tried worked to fix this, so finally i just decided to change all the files to a .html extension and then rewrote my htaccess to handle html files as php. absolutely bizzare and weird, but it worked.

Indefinetely under construction - Plaid Screen Studios - www.plaidscreen.com