If memory limit is enabled by your configure script, memory_limit also affects file uploading.
Sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize.