UPLOAD_ERR_CANT_WRITE但是其他文件正在上传 [英] UPLOAD_ERR_CANT_WRITE But other files are getting uploaded
问题描述
我在服务器中遇到一种非常奇怪的行为.
I am facing a quite weird behavior in my server.
我可以上传小于1MB的任何文件而没有问题,但是较大的文件会返回错误UPLOAD_ERR_CANT_WRITE == 7.
I can upload any files smaller than 1MB without problem, but those that are bigger return me an error UPLOAD_ERR_CANT_WRITE == 7.
tmp/文件夹具有权限,因为我可以上传其他文件.
The tmp/ folder has permissions since I can upload other files.
PHP.INI上的配置似乎很好,我之前使用phpmyadmin确实上传了大于1MB的文件,并且可以正常工作.
The config on my PHP.INI seems to be fine, I did upload files larger than 1MB using phpmyadmin before and it worked.
PHP.INI
- file_uploads开启
- post_max_size 200M
- 最大执行时间30
- memory_limit 128M
- max_file_uploads 20
- upload_max_filesize 200M
- upload_tmp_dir/tmp
有什么我想念的吗?在我的本地机器上完全相同的配置:S
There's something I am missing? at my local machine works perfectly same config :S
我使用ubuntu服务器13.04 PHP 5.4.9和Apache 2.2.22
I use ubuntu server 13.04 PHP 5.4.9 and Apache 2.2.22
当然是有史以来最愚蠢的事情,我在其中浪费了2个小时,我已经在php.net上检查了很多文档,但是没有运气.任何帮助都超过了欢迎.
Sure is the most stupid thing ever and I wasted 2 hours in this, I already have checked loads of docs at php.net but no luck. Any help is more than welcome.
谢谢!
2014年10月1日更新:还是没有运气,我无法解决它.
UPDATE 10-01-2014: Still no luck I could not fix it.
推荐答案
感谢您的所有回答,我发现了错误.
Thanks to all your answers I found the error.
该服务器是由OVH安装程序完成的Ubuntu安装.我不知道的是,它们将以这种糟糕的方式创建分区:
The server is an Ubuntu installation done by OVH installer. What I was not aware is that they will create the partitions in such a poorly way:
- 已使用的文件系统大小可用百分比已安装在 上
- 溢流100万136K 888K 14%/tmp
- /dev/md2 1.8T 13G 1.7T 1%/home
- Filesystem Size Used Avail Use% Mounted on
- overflow 1.0M 136K 888K 14% /tmp
- /dev/md2 1.8T 13G 1.7T 1% /home
所以我所做的就是在php.ini中将upload_tmp_dir修改为另一个具有空格的文件夹...
So what I did is modify in php.ini the upload_tmp_dir to another folder with space...
可怕的是我浪费了太多时间,我从来没有想过这实际上是一个空间问题,因为在HD中我有2TB!
Terrible I've wasted so much time, I never thought was actually an space issue, since in the HD I have 2TB!
再一次感谢,希望这对其他人有用.
Once more thanks and hope this may work to someone else.
这篇关于UPLOAD_ERR_CANT_WRITE但是其他文件正在上传的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!