php session_start /tmp permission issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • icycle
    Junior Member
    • Apr 2004
    • 15

    #1

    php session_start /tmp permission issue

    OK, I've banged my head on this one long enough, now time to admit my ignorance :-)

    I created a new account on cpanel32b: user "y". For some reason, "y" is unable to create sessions with php using /tmp as the temp. dir. I get permission issue as shown here:

    Warning: session_start(): open(/tmp/sess_RANDCHARSTRING, O_RDWR) failed: Permission denied (13) in /home/y/public_html/modules/gallery/setup/session_test.php on line 30
    If I override with a php.ini in that directory containing:
    session.save_path = "/home/y/tmp"
    then it works. But I don't understand. My other user on the same server, "x", is able to do this operation fine and the perms on /tmp seem equal to both (777).

    There are no .htaccess files in the public_html or current directories either. I'm stuck--I have a workaround but I don't want to use it. I don't want to manage my own temp space when it should be available in /.

    All the help I've seen on gallery and from google say that /tmp permissions are insufficient. However, I've verified above that both accounts see 777 with a `df -ld /tmp` Additionally, I've tried inserting some test lines into the session_test.php file:
    <?php
    $sourcefile = tempnam("/tmp", "test");
    echo "$sourcefile <br>";
    $handle = fopen($sourcefile, "w");
    echo "handle is $handle <br>";
    $r = fwrite($handle, "testing");
    echo "fwrite ret $r <br>";
    $r = fclose($handle);
    echo "fclose ret $r <br>";

    $fd = fopen($sourcefile, "r");
    echo "fd is $fd<br>";
    $contents = fread($fd, filesize($sourcefile));
    fclose($fd);

    echo "$contents<br>";
    ?>
    And both "/tmp" and "/home/y/tmp" as prefixes (i.e. arg1) to tempnam WORK--i.e. the test file is written and read successfully.

    Any clues? What am I missing or is this a trouble ticket issue?

    thanks
    Brett
  • icycle
    Junior Member
    • Apr 2004
    • 15

    #2
    problem &quot;fixed itself&quot;

    Well, I woke up this morning and the problem was gone. So perhaps since "y" was a new user created last night, there was something that wasn't set correctly on that account and it relied upon a cron job or something to set things right. Either that or an admin saw the post and made a repair. All I know is I changed nothing, just waited.

    Happy now,
    Brett

    Comment

    • icycle
      Junior Member
      • Apr 2004
      • 15

      #3
      hmmm

      Now the problem occurs with account "x" instead!! I populated the "y" account from the "x" account (using `scp -pr`). In this particular instance it's the gallery installation that's in question but it's a general php session error. The file/directory ownerships are sane--"x" owns x's files and "y" owns y's.

      If this were more than a seemingly simple php permission issue I'd suspect user error. Could this be a php suexec problem? I ran:
      find -perm +020 -o -perm +002
      to check from both users' home dirs and found nothing relevant. Also, there are no php values in any .htaccess files and the gallery .htaccess is empty.

      Any ideas?
      thanks,
      Brett

      Comment

      Working...