NOTE: I’m a novice with PHP.
My PHP code uploads small files but silently fails with a test file of about 11M. So, I found a number of related questions, such as this one, and from that found /etc/php.ini, and updated post_max_size to zero and, since it doesn’t appear to have a “don’t set a limit”, set upload_max_filesize to 128G – that ought to do it!
But no?!
I stopped Apache and restarted it, reloaded the client-side while testing, but it still doesn’t work.
If you want to see the code – this is only the PHP portion… MAYBE some other aspect of this Apache configuration is holding back my application?
To wit:
<?php
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (isset($_FILES['files'])) {
$errors = [];
$path = 'uploads/';
$extensions = ['jpg', 'jpeg', 'png', 'gif', 'txt', 'mpeg'];
$all_files = count($_FILES['files']['tmp_name']);
for ($i = 0; $i < $all_files; $i++) {
$file_name = $_FILES['files']['name'][$i];
$file_tmp = $_FILES['files']['tmp_name'][$i];
$file_type = $_FILES['files']['type'][$i];
$file_size = $_FILES['files']['size'][$i];
$file_ext = strtolower(end(explode('.', $_FILES['files']['name'][$i])));
$file = $path . $file_name;
move_uploaded_file($file_tmp, $file);
}
if ($errors) print_r($errors);
}
}
An additional issue is that I’m not getting any error output, but then maybe I’m not looking where the print_r code would send it? I’d like it to show up on the client-side’s browser window “on the page.”