php “写入失败:设备上没有剩余空间”是什么意思?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5412435/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 21:18:56  来源:igfitidea点击:

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

phpdiskspace

提问by Michael

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 space left on device (28) 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

采纳答案by nicolaas

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

我假设您在共享托管服务提供商上托管您的站点基本上该错误意味着服务器已用完磁盘空间,因此它无法完成 sql 命令

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

只需致电/发送电子邮件给托管公司,他们就会为您解决问题

回答by Fernando

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).

创建目录:/public_htm/tmp,授予权限(777)<-然后您必须对其进行调整(为了安全)。

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

在目录 /public_htm/tmp 中创建一个文件 .htaccess :

order deny, allow
deny from all
allow from 127.0.0.1

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

在您的 PHP 脚本中,在顶部(在您的前端控制器中):

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

Important: You must be added before session_start()

重要提示:必须在 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"

检查是否更改了指令“session.save_path”

回答by Angelinux

df -h

df -h

to look /tmp space left.

查看 /tmp 剩余空间。

If /tmp is over 100%

如果 /tmp 超过 100%

cd /tmp

rm -r ./* -f

cd /tmp

rm -r ./* -f

And you can save sessions again.

您可以再次保存会话。

回答by vivoconunxino

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

如果您有分区 ( df -h) 并且您托管的那个 mysql 已满。

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.

将占用更多空间的文件夹移动到新分区,在我的情况下mv /var/mail /home,并创建一个 symlink sudo ln -s /home/mail mail。你可以移动mysql本身。