What does “write failed: No space left on device” mean?

后端 未结 4 669
情书的邮戳
情书的邮戳 2020-12-11 00:53

I am getting these errors on my site, yet i haven\'t changed any code or anything, so I don\'t why this is happening.

Warning: Unknown(): write failed: No sp         


        
相关标签:
4条回答
  • 2020-12-11 01:03

    I'm assuming you're hosting your site on a shared hosting provider Basicly the error means that the server has run out of disk space, so it can't complete the sql commands

    Just call/email the hosting company and they should fix it for you

    0 讨论(0)
  • 2020-12-11 01:15

    In a shared hosting, change the location where sessions are saved.

    Create the directory: /public_htm/tmp, give the permissions (777) <- then you have to tune it (for security).

    Create a file .htaccess in the directory /public_htm/tmp with:

    order deny, allow
    deny from all
    allow from 127.0.0.1
    

    And in your PHP script, on top (in your front controller):

    session_save_path(dirname($_SERVER['DOCUMENT_ROOT']).'/public_html/tmp');
    

    Important: You must be added before session_start()

    Check this with a script:

    <?php
    session_save_path(dirname($_SERVER['DOCUMENT_ROOT']).'/public_html/tmp');
    session_start();
    $_SESSION['Text'] = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed quis nunc eu ut elit eget adipiscing facilisis turpis."
    phpinfo();
    ?>
    

    Check if changed the directive "session.save_path"

    0 讨论(0)
  • 2020-12-11 01:20

    df -h

    to look /tmp space left.

    If /tmp is over 100%

    cd /tmp

    rm -r ./* -f

    And you can save sessions again.

    0 讨论(0)
  • 2020-12-11 01:28

    If you have partitions (df -h) and the one you're hosting the mysql is full.

    Move the folders that are more size consuming to the new partition, in my case mv /var/mail /home, and create a symink sudo ln -s /home/mail mail. You can move mysql itself.

    0 讨论(0)
提交回复
热议问题