requireAuth(); header('Content-Type: application/json'); $result = [ 'success' => false, 'size' => 0, 'error' => 'No file uploaded', 'php_info' => [ 'upload_max_filesize' => ini_get('upload_max_filesize'), 'post_max_size' => ini_get('post_max_size'), 'memory_limit' => ini_get('memory_limit') ], 'server_info' => [ 'content_length' => $_SERVER['CONTENT_LENGTH'] ?? 0, 'content_type' => $_SERVER['CONTENT_TYPE'] ?? 'unknown' ] ]; if (isset($_FILES['test_file'])) { $file = $_FILES['test_file']; $result['size'] = $file['size']; $result['original_name'] = $file['name']; $result['type'] = $file['type']; $result['error_code'] = $file['error']; if ($file['error'] === UPLOAD_ERR_OK) { $result['success'] = true; $result['message'] = 'Upload successful'; } else { $result['error'] = getUploadErrorMessage($file['error']); } } echo json_encode($result); exit; } // Start session for main page if (session_status() === PHP_SESSION_NONE) { session_start(); } require_once '../includes/config.php'; require_once '../includes/database.php'; require_once '../includes/auth.php'; // Require authentication $auth = new Auth(); $auth->requireAuth(); ?>
| Setting | Current Value | Recommended | Status |
|---|---|---|---|
| {$key} | {$current} | {$recommended} | {$status} |
| Item | Value |
|---|---|
| PHP Version | |
| Web Server | |
| Server API | |
| Document Root | |
| Max Request Size (calculated) | bytes |
Test different file sizes to identify the exact limit:
Important: The error "client intended to send too large body" indicates an nginx limit.
Check these nginx settings in your server configuration:
client_max_body_size - Default is 1MB, should be higherclient_body_buffer_size - Buffer size for request bodyclient_header_timeout - Timeout for client headersclient_body_timeout - Timeout for client body
server {
listen 80;
server_name samuli.valavuo.net;
root /path/to/website;
index index.php;
# Increase upload limits
client_max_body_size 25M;
client_body_buffer_size 128k;
client_body_timeout 60s;
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
client_max_body_size 25M; and restart nginx