php image upload errors [duplicate]

2019-01-29 08:58发布

问题:

This question is an exact duplicate of:

  • Cannot upload image above 70kb [closed] 2 answers

Im using Zend Framework in cms .I can upload below 70kb image size but can't upload above 70kb image
errors in browser

browser response Post image failed and sometimes failed to load resource

how to solve this issue

回答1:

Most often, when your ini upload settings are fine, the other problem is the temp upload directory. By default, this is the /tmp folder. If you do not have enough space in your tmp directory or there are other limitations, you may run into this issue.

Check your php.ini setting "upload_tmp_dir" - also check the location where that is set.

Perhaps, if you're in a shared hosting environment, you're not allowed that much room in tmp. You may want to change that directory to a different directory in your home directory, but NOT publicly accessible to the web. Of course, don't forget to use move_uploaded_file() to make sure that the processed file isn't duplicated in your home directory AND in wherever you store it.