Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-23-2013, 05:03 AM   PM User | #1
ikasif
New to the CF scene

 
Join Date: Feb 2013
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
ikasif is an unknown quantity at this point
Exclamation Warning: session start() [function.session-start]: open(/tmp/sess_

Please any one help me,
I suffer a big problem from some days,
my toplist site-"www.worldtops.info" has given some warning report on site top and bottom.
those are on site header-
"Warning: session_start() [function.session-start]: open(/tmp/sess_525041c925c58c85feba777b5d3c1be7, O_RDWR) failed: Permission denied (13) in /home/worldtop/public_html/index.php on line 0

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/worldtop/public_html/index.php:0) in /home/worldtop/public_html/index.php on line 0

Warning: Cannot modify header information - headers already sent by (output started at /home/worldtop/public_html/index.php:0) in /home/worldtop/public_html/index.php on line 0

Warning: Cannot modify header information - headers already sent by (output started at /home/worldtop/public_html/index.php:0) in /home/worldtop/public_html/index.php on line 0

Warning: Cannot modify header information - headers already sent by (output started at /home/worldtop/public_html/index.php:0) in /home/worldtop/public_html/index.php on line 0

and bottom has given-
"Warning: Unknown: open(/tmp/sess_525041c925c58c85feba777b5d3c1be7, O_RDWR) failed: Permission denied (13) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0

please any one give me tips and solution for solve its.
thank you.
ikasif is offline   Reply With Quote
Old 02-23-2013, 08:23 AM   PM User | #2
Arcticwarrio
Regular Coder

 
Arcticwarrio's Avatar
 
Join Date: May 2012
Location: UK
Posts: 575
Thanks: 15
Thanked 64 Times in 64 Posts
Arcticwarrio is on a distinguished road
session_start() needs to be the first line of your script straight after <?PHP and at the verry top of your page before anything else

eg.

PHP Code:
<?php
session_start
();
//blah blah
__________________
There are 10 types of people on CodingForums,
Those who understand Binary and those who dont.

Last edited by Arcticwarrio; 02-23-2013 at 08:25 AM..
Arcticwarrio is offline   Reply With Quote
Old 02-23-2013, 12:59 PM   PM User | #3
tangoforce
Senior Coder

 
tangoforce's Avatar
 
Join Date: Feb 2011
Location: Your Monitor
Posts: 3,496
Thanks: 44
Thanked 439 Times in 428 Posts
tangoforce will become famous soon enoughtangoforce will become famous soon enough
Quote:
Originally Posted by ikasif View Post
please any one give me tips and solution for solve its.
1) Show source code.
2) Contact your host about the permission denied error.
3) session_start() must be used before any other output that triggers the headers to be sent - see the link in my signature.
__________________
Please wrap your code in [php] tags. It is a sticky topic and it HELPS us to HELP YOU!
TIP: Coding styles and $end errors :::::::::: TIP: Warning: Cannot modify header information - headers already sent :::::::::: TIP: Quotes / Parse error: syntax error, unexpected T_..
PHP Code:
//Please don't use this for your form processing:
if (isset($_POST['submit']))
//Internet explorer has a bug and does not always send the submit value. 
Explanation: The IE if(isset($_POST['submit'])) bug explained.
tangoforce is offline   Reply With Quote
Old 02-23-2013, 03:43 PM   PM User | #4
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,635
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
The errors indicate that the ordering is fine. This problem should be resolved once the permission issues are fixed; everything indicates that the error output is caused on line 0, which was caused by attempting to open the file and discovering there is no permissions, and then flushing the headers to display the error.
You can also change the location of your session files too by using the ini_set('session.save_path', '/path/to/your/sessions'); or by modifying a local htaccess / php.ini script. You shouldn't have to do this of course; your host has biffed the permissions on the /tmp directory.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
Fou-Lu is offline   Reply With Quote
Old 02-23-2013, 09:14 PM   PM User | #5
tangoforce
Senior Coder

 
tangoforce's Avatar
 
Join Date: Feb 2011
Location: Your Monitor
Posts: 3,496
Thanks: 44
Thanked 439 Times in 428 Posts
tangoforce will become famous soon enoughtangoforce will become famous soon enough
Quote:
Originally Posted by Fou-Lu View Post
everything indicates that the error output is caused on line 0
Urrgh how did I not see that?

I think I'm loosing the plot..
__________________
Please wrap your code in [php] tags. It is a sticky topic and it HELPS us to HELP YOU!
TIP: Coding styles and $end errors :::::::::: TIP: Warning: Cannot modify header information - headers already sent :::::::::: TIP: Quotes / Parse error: syntax error, unexpected T_..
PHP Code:
//Please don't use this for your form processing:
if (isset($_POST['submit']))
//Internet explorer has a bug and does not always send the submit value. 
Explanation: The IE if(isset($_POST['submit'])) bug explained.
tangoforce is offline   Reply With Quote
Old 02-25-2013, 04:06 AM   PM User | #6
ikasif
New to the CF scene

 
Join Date: Feb 2013
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
ikasif is an unknown quantity at this point
how can solve please give me clear tips. why those problem has given? for server problem or for my php script problem?
and how can it's solve?
Thank you
ikasif is offline   Reply With Quote
Old 02-25-2013, 01:08 PM   PM User | #7
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,635
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
Quote:
Originally Posted by ikasif View Post
how can solve please give me clear tips. why those problem has given? for server problem or for my php script problem?
and how can it's solve?
Thank you
This will be a server configuration problem. /tmp isn't set to allow read+write access for the apache user. So contact your host and tell them that the /tmp isn't configured properly.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
Fou-Lu is offline   Reply With Quote
Users who have thanked Fou-Lu for this post:
ikasif (02-25-2013)
Old 02-25-2013, 02:59 PM   PM User | #8
ikasif
New to the CF scene

 
Join Date: Feb 2013
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
ikasif is an unknown quantity at this point
I contected with server admintators.
they has given me good response.
but they can not solve this problem from end.
If you give me details soliution, how to solve this problem? and how to set /tmp config properly?
I will be give your soliution to my host adminstators.
thank you.
ikasif is offline   Reply With Quote
Old 02-25-2013, 03:20 PM   PM User | #9
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,635
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
ssh in as root and issue chmod 777 /tmp.

Edit:
BTW, it sounds to me like you need a new host if they need pointers for setting chmod.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
Fou-Lu is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:28 AM.


Advertisement
Log in to turn off these ads.