简体   繁体   English

LAMP错误:session_start()失败:设备(28)上没有剩余空间,但是

[英]LAMP error: session_start() failed: No space left on device (28), but

Ubuntu server 10.04, Apache 2.2.14, PHP 5.3.2, MySQL. Ubuntu服务器10.04,Apache 2.2.14,PHP 5.3.2,MySQL。 For the drive where session files are stored: 对于存储会话文件的驱动器:

df -h: df -h:

Filesystem            Size  Used Avail Use% Mounted on
/dev/md1              450G   86G  341G  21% /

df -ih: df -ih:

Filesystem            Inodes   IUsed   IFree IUse% Mounted on
/dev/md1                116M    9.4M    107M    9% /

Any ideas? 有任何想法吗?

Finally remembered to answer with the solution! 终于想起了解答的答案! Turns out there were too many files in one directory. 原来,一个目录中文件太多。 Had to start hashing the session files into subdirectories. 必须开始将会话文件散列到子目录中。

Apache reports this error when it can't register a lock on a file(which it assumes is because the fs is full). 当无法注册文件锁时,Apache报告此错误(它假定是因为fs已满)。 Next time it occurs try running 下次发生时尝试运行

ipcs -s

and look for an abundance of registered locks owned by the apache process. 并寻找apache进程拥有的大量注册锁。 You can then either remove them with ipcrm, or raise their limit with the kernel variable (kernel.sem) as mentioned In this blog post . 然后,您可以使用ipcrm删除它们,也可以使用内核变量(kernel.sem)来提高其限制,如本博客文章中所述

just check in the php.ini file where the sessions file are stored, and then check the free space, if is 100% used, change the fstab configuration (in case of a (re)mounted directory) and restart the server, or change the path and restart the apache server. 只需检查存储会话文件的php.ini文件,然后检查可用空间(如果已100%使用),则更改fstab配置(如果是(重新)安装的目录)并重新启动服务器,或更改路径并重启apache服务器。

In my case: 就我而言:

evo ~ # locate php.ini
/etc/php/apache2-php5/php.ini
/etc/php/cli-php5/php.ini

evo ~ # grep -v ";" /etc/php/apache2-php5/php.ini | grep session | grep path
session.save_path = "/tmp"
session.cookie_path = /

evo ~ # grep -v ";" /etc/php/cli-php5/php.ini | grep session | grep path
session.save_path = "/tmp"
session.cookie_path = /

evo ~ # df -ha /tmp   
Filesystem            Size  Used Avail Use% Mounted on
/dev/root             230G   27G  203G  12% /

evo ~ # df -ha / 
Filesystem            Size  Used Avail Use% Mounted on
/dev/root             230G   27G  203G  12% /

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM