move_uploaded_file not working although my file has been uploaded correctly

319 views Asked by At

I'm stuck with a strange bug which I can't understand. Here's the background :

I set up a form to upload video files whose size can vary from 2M up to 6G. The file is uploaded then moved via mode_uploaded_file after some DB recordings (the $media variable is an object representing the media, and $fichier is an alias to $_FILES) :

$destination_dir  = sfConfig::get($media instanceof Image ? 'app_snapshot_dir' : 'app_wowza_content_dir');
$destination_file = $destination_dir . '/' . preg_replace('/^(.+)\.(.+)$/', ('${1}' . ($media->isImage() ? '' : '_base') . '.${2}'), Media::standardize($media->getFSFileName($fichier['name'])));
$deplacement      = move_uploaded_file($fichier['tmp_name'], $destination_file); // Here I get false, without any additional errors.

The script works perfectly if I send files up to 700M, but the move_uploaded_file part returns false (but no additional info) when the file is bigger.

Obviously, I set my php.ini directives accordingly :

upload_max_filesize = 12G
post_max_size = 12G
max_input_time = 0
max_execution_time =0

But the problem remains : the temp file is here, but it's not moved. PHP is running with PHP-FPM, and checked the destination folder, which has the perms 2777 and is owned by the user running the php-fpm process.

0

There are 0 answers