Improve company productivity with a Business Account.Sign Up

x
?
Solved

check to see if session_start() exists.

Posted on 2007-12-04
3
Medium Priority
?
1,845 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 2000 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

I recently worked on a Wordpress site that utilized the popular ContactForm7 (https://contactform7.com/) plug-in that only sends an email and does not save data. The client wanted the data saved to a custom CRM database. This is my solution.
Laravel is the most sought after web development framework. It comes with ample amount of features that make it easy for developers to work around it. Know about its features in detail.
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…
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…

606 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