What could be causing the PHP script to abort when uploading large files?

When uploading large files, the PHP script may be hitting the server's upload limits or running out of memory. To solve this issue, you can increase the upload_max_filesize and post_max_size directives in your php.ini file, or you can handle large file uploads using chunked uploads or streaming methods in your PHP script.

// Increase upload limits in php.ini
ini_set('upload_max_filesize', '20M');
ini_set('post_max_size', '25M');

// Handle large file uploads using chunked uploads or streaming methods
// Example code for handling file uploads using chunked uploads
if ($_SERVER['REQUEST_METHOD'] === 'POST' && !empty($_FILES['file'])) {
    $file = $_FILES['file'];
    
    // Handle file upload logic here
}