move_uploaded_file doesn't work, no error

ぃ、小莉子 提交于 2019-12-01 04:25:46
sbditto85

Just to verify is the post_max_filesize set to a high level? Because according to php.net:

If the size of post data is greater than post_max_size, the $_POST and $_FILES superglobals are empty. This can be tracked in various ways, e.g. by passing the $_GET variable to the script processing the data, i.e. <form action="edit.php?processed=1">, and then checking if $_GET['processed'] is set.

Something to consider.

for more info see this link and scroll down to the post_max_filesize section

UPDATE

In my experience if you're getting a WSOD it's usually do to error_reporting and display_errors being turned off OR the memory_limit being reached. In the script at the top I usually set the memory_limit to 1024M to verify that isn't the problem and the turn on error_reporting and display_errors... so put this before the file upload:

error_reporting(E_ALL); // or E_STRICT
ini_set("display_errors",1);
ini_set("memory_limit","1024M");

That normally gets rid of the WSOD and gives you and error to work with.

UPDATE

Have you tried taking off the @ error suppression in front of all your functions to see they are producing a specific error? Also what are you execution and input timeouts? and Can you verify what headers are being sent? (make sure it is Content-Type=text/html;)

Try changing the target path to a non temp directory.

After some of the updates here is the resolution:

set_time_limit(0);
ini_set('upload_max_filesize', '500M');
ini_set('post_max_size', '500M');
ini_set('max_input_time', 4000); // Play with the values
ini_set('max_execution_time', 4000); // Play with the values

...add this to the beginning of your file that processes the upload.

[error] => 1 means The uploaded file exceeds the upload_max_filesize directive in php.ini.
http://www.php.net/manual/en/features.file-upload.errors.php

So, you have to change your settings.

as for the php.ini file you posted here, it just doesn't affect your PHP. you have to move it somewhere to more proper location

I had the same problem last week, it was just because my server space disk was full! I hope it will help someone...

I had same problem, but I wanted to overwrite a file, so I have to delete old file and than it works.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!