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
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.
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.
mkdir /usr/tmp
mv /tmp/* /usr/tmp
sudo umount -l /tmp
mv /usr/tmp/* /tmp
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:
ls -la /yourUploadDirectory
You should see something like:
drwxr-xr-x 65 user group 4096 nov 13 09:47 .
drwxr-xr-x 3 user group 4096 ago 7 18:09 ..
group
of .
directory (first line) should be www-data
. If it's not do:
chown yourUser:www-data /yourUploadDirectory
Also drwxr-xr-x
should be drwxrwxr-x
. If it's not do:
chmod 0775 /yourUploadDirectory
Now you're done to upload.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With