Solved

check to see if session_start() exists.

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

Easy Project Management (No User Manual Required)

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to count occurrences of each item in an array.
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…

757 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now