Solved

check to see if session_start() exists.

Posted on 2007-12-04
3
1,826 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

734 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