Код: Выделить всё
// Check if the file was uploaded
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['file'])) {
$file = $_FILES['file'];
// Check for errors in the upload process
if ($file['error'] === UPLOAD_ERR_OK) {
// Define the target path in the /tmp directory
$targetPath = '/opt/upload/' . basename($file['name']);
// Move the uploaded file to the target path
if (move_uploaded_file($file['tmp_name'], $targetPath)) {
echo "File uploaded successfully to /tmp.";
} else {
echo "Failed to move the file to /tmp.";
}
} else {
echo "Error in file upload: " . $file['error'];
}
} else {
echo "No file uploaded.";
}
а в журнале Tail -f /var/log/apache2/error.log можно увидеть
Код: Выделить всё
[mpm_prefork:notice] AH00170: caught SIGWINCH, shutting down gracefully
[mpm_prefork:notice] AH00163: Apache/2.4.52 (Ubuntu) configured -- resuming normal operations
[core:notice] AH00094: Command line: '/usr/sbin/apache2'
Код: Выделить всё
post_max_size=20G
Что происходит? Почему я не могу загрузить большой файл, а с маленькими он работает?
Подробнее здесь: https://stackoverflow.com/questions/791 ... e2-and-php
Мобильная версия