The problem described here was solved by me quite a long time ago but I don't really remember what was the main reason that uploads weren't working. There were multiple things that needed fixing so the upload could work. I have created checklist that might help others having similar problems and I will edit it to make it as helpful as possible. As I said before on chat, I was working on embedded system, so some points may be skipped on non-embedded systems.
upload_tmp_dirin php.ini. This is directory where PHP stores temporary files while uploading.
open_basedirin php.ini. If defined it limits PHP read/write rights to specified path and its subdirectories. Ensure that
upload_tmp_diris inside this path.
post_max_sizein php.ini. If you want to upload 20 Mbyte files, try something a little bigger, like
post_max_size = 21M. This defines largest size of POST message which you are probably using during upload.
upload_max_filesizein php.ini. This specifies biggest file that can be uploaded.
memory_limitin php.ini. That's the maximum amount of memory a script may consume. It's quite obvious that it can't be lower than upload size (to be honest I'm not quite sure about it-PHP is probably buffering while copying temporary files).
Ensure that you're checking the right php.ini file that is one used by PHP on your webserver. The best solution is to execute script with directive described here http://php.net/manual/en/function.php-ini-loaded-file.php (
Check what user php runs as (See here how to do it: How to check what user php is running as? ). I have worked on different distros and servers. Sometimes it is
apache, but sometimes it can be
root. Anyway, check that this user has rights for reading and writing in the temporary directory and directory that you're uploading into. Check all directories in the path in case you're uploading into subdirectory (for example
On embedded platforms you sometimes need to restrict writing to root filesystem because it is stored on flash card and this helps to extend life of this card. If you are using scripts to enable/disable file writes, ensure that you enable writing before uploading.
If you make any changes in php.ini remember to restart server so the configuration will be reloaded.