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

时间:2022-09-17 07:56:36

Ubuntu server 10.04, Apache 2.2.14, PHP 5.3.2, MySQL. For the drive where session files are stored:

Ubuntu服务器10.04,Apache 2.2.14,PHP 5.3.2,MySQL。对于存储会话文件的驱动器:

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?

有任何想法吗?

3 个解决方案

#1


2  

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.

终于记得用解决方案回答!原来在一个目录中有太多文件。不得不开始将会话文件散列到子目录中。

#2


1  

Apache reports this error when it can't register a lock on a file(which it assumes is because the fs is full). Next time it occurs try running

Apache无法在文件上注册锁定时报告此错误(它假定是因为fs已满)。下次发生尝试运行

ipcs -s

and look for an abundance of registered locks owned by the apache process. You can then either remove them with ipcrm, or raise their limit with the kernel variable (kernel.sem) as mentioned In this blog post.

并寻找apache进程拥有的大量注册锁。然后,您可以使用ipcrm删除它们,或者使用内核变量(kernel.sem)提高它们的限制,如本博文中所述。

#3


0  

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% /

#1


2  

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.

终于记得用解决方案回答!原来在一个目录中有太多文件。不得不开始将会话文件散列到子目录中。

#2


1  

Apache reports this error when it can't register a lock on a file(which it assumes is because the fs is full). Next time it occurs try running

Apache无法在文件上注册锁定时报告此错误(它假定是因为fs已满)。下次发生尝试运行

ipcs -s

and look for an abundance of registered locks owned by the apache process. You can then either remove them with ipcrm, or raise their limit with the kernel variable (kernel.sem) as mentioned In this blog post.

并寻找apache进程拥有的大量注册锁。然后,您可以使用ipcrm删除它们,或者使用内核变量(kernel.sem)提高它们的限制,如本博文中所述。

#3


0  

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% /