Solved

check to see if session_start() exists.

Posted on 2007-12-04
3
1,823 Views
Last Modified: 2013-12-12
I'm developing a cart and got most of the code ready to roll. My only problem now is my sessions. I insert session_start() into the first lines of my catalog and cart pages only to have these two errors spit back out to me.

Warning: session_start() [function.session-start]: open(/tmp/sess_6m5puuj2bvar893mas59sjit13, O_RDWR) failed: Permission denied (13) in /home/.eunice/cbmclients/gomsg.custombusinessmarketing.com/credit-card-terminals.html on line 2

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/.eunice/cbmclients/gomsg.custombusinessmarketing.com/credit-card-terminals.html:2) in /home/.eunice/cbmclients/gomsg.custombusinessmarketing.com/credit-card-terminals.html on line 2


I have tried sticking session_start() into my header file but then i get that error through out my entire site. What does this error mean and how can I get rid of it? Thank you.
0
Comment
Question by:FathomX
3 Comments
 
LVL 3

Accepted Solution

by:
yjwong earned 500 total points
ID: 20404430
This means that your webhost's /tmp directory is not writable. PHP stores its session data in the /tmp directory on *nix-based platforms by default. You might want to contact your webhost on more information why the directory is not writable.

Alternatively, you can use the session_save_path() function to change where PHP saves the session data. For example, you could do:

session_save_path("./sessions/");

to save the session data into a directory named "sessions" within the current working directory (the directory where the PHP script is). Note that it is NOT SECURE to place the session data in your document root (i.e. your webspace where everyone can access), or in a world-readable place.
0
 
LVL 1

Author Closing Comment

by:FathomX
ID: 31412615
thanks i'll see what i can do ^_^
0
 
LVL 12

Expert Comment

by:Rok-Kralj
ID: 20404532
You have not enough permissions to write /tmp/ or the disk is full.
Alternatively, you can set /tmp/ directory rights to 777.

You can avoid using php default session manager and use your own session class (more work, more knowledge required, but more flexible and reliable)...
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question