Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New to the CF scene
    Join Date
    Feb 2013
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    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.

  • #2
    Regular Coder Arcticwarrio's Avatar
    Join Date
    May 2012
    Location
    UK
    Posts
    721
    Thanks
    20
    Thanked 84 Times in 84 Posts
    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
    Last edited by Arcticwarrio; 02-23-2013 at 08:25 AM.
    There are 10 types of people on CodingForums,
    Those who understand Binary and those who dont.
    Get Cloud Hosting now from only£59 / month

  • #3
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,352
    Thanks
    61
    Thanked 528 Times in 515 Posts
    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.
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    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.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • #5
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,352
    Thanks
    61
    Thanked 528 Times in 515 Posts
    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..
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!

  • #6
    New to the CF scene
    Join Date
    Feb 2013
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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

  • #7
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    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.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • Users who have thanked Fou-Lu for this post:

    ikasif (02-25-2013)

  • #8
    New to the CF scene
    Join Date
    Feb 2013
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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.

  • #9
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    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.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •