Solved

check to see if session_start() exists.

Posted on 2007-12-04
3
1,821 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

770 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