Hello, I have been getting these "PERMISSION DENIED" errors (see below) on some of my pages. I used to not get them until a few days ago so I am trying to figure what might have changed/happened.
On of the pages in question is: http://www.marcurselli.com/music/index.php

Is there some kind of resetting or chmod-ing I need to do to give my server permission to write temporary session files?

Thank you

Errors below:

Warning: session_start(): open(/tmp/sess_9aec54e97e8b438ad4f00e9a1bd93d25, O_RDWR) failed: Permission denied (13) in /home4/marcurse/public_html/dl/library.inc.php on line 51


Warning: Unknown(): open(/tmp/sess_9aec54e97e8b438ad4f00e9a1bd93d25, 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

    Stab in the dark: Is /tmp on a partition that's run out of disk space?

    On the command line, type du -h
    Look for any partitions that are at 100%

    Also, find out if there are any other scripts that are running on the server that use /tmp and see if they are writing very large files there that could cause it to run out of space?

      Thanks for answering...

      I wish I could answer that but I am renting space from a shared hosting company so I don't know if their partitions are running low and I don't know if I have shell access, and if I did, I never used it and I am not familiar with linux.

      The only other script I am using on my account (which I am sure is one of many accounts on that server) is WordPress, which seems to work fine. I am sure WP uses sessions as well but I don't get any errors from WP although it probably writes to the same /tmp folder, right?

      Is there ANY way this could be dependent on my software (the script of that page)? or is this definitely a server-side issue?

      Thanks

        marcnyc wrote:

        Is there ANY way this could be dependent on my software (the script of that page)?

        Highly unlikely, but let's make sure - try a script like this:

        <?php
        session_start();
        $_SESSION['test'] = 'testing';
        session_write_close();
        ?>

        Do you see the errors? If so, it's time to contact your hosting company.

          You may wish to set the session save directory to somewhere other than /tmp. Having said that, /tmp should always be writeable.

          Contact your provider. They will be able to advise you where to store session temporary files.

          Unfortunately you shouldn't hard-code the session path otherwise the application won't work on other servers (e.g. your development server). So it might be a good idea to have it configurable (or specify in your application system requirements that the session save directory must be set correctly).

          It depends on the exact deployment scenario. If you can rely on your systems managers to always set the right session save directory and ensure its writability, that is best.

          Mark

            I contacted my host and they fixed the problem. They didn't say what they did to fix it however. Thanks for all your help and replies, guys, I appreciate.

              Write a Reply...