I am facing a quite weird behavior in my server.
I can upload any files smaller than 1MB without problem, but those that are bigger return me an error UPLOAD_ERR_CANT_WRITE == 7.
The tmp/ folder has permissions since I can upload other files.
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 On
- post_max_size 200M
- max_execution_time 30
- memory_limit 128M
- max_file_uploads 20
- upload_max_filesize 200M
- upload_tmp_dir /tmp
There's something I am missing? at my local machine works perfectly same config :S
I use ubuntu server 13.04 PHP 5.4.9 and Apache 2.2.22
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.
Thanks!!!
UPDATE 10-01-2014: Still no luck I could not fix it.
It is probably due to your
memory_limit
configuration. Try to replace with 256M. If it works you should review your code to minify memory usage.If it is due to your permissions configuration you'll see with:
You should see something like:
group
of.
directory (first line) should bewww-data
. If it's not do:Also
drwxr-xr-x
should bedrwxrwxr-x
. If it's not do:Now you're done to upload.
Thanks to all your answers I found the error.
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:
So what I did is modify in php.ini the upload_tmp_dir to another folder with space...
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.
Delete or move all files from /tmp and unmount the device so it uses the normal partition for /tmp.