How can one debug file upload failures in PHP under Windows IIS?

File upload failures in PHP under Windows IIS can be debugged by checking the file upload settings in the php.ini file, ensuring that the upload_max_filesize and post_max_size are set to appropriate values. Additionally, checking the file permissions of the upload directory to ensure that the web server has write access can help resolve upload failures.

// Check file upload settings in php.ini
echo ini_get('upload_max_filesize');
echo ini_get('post_max_size');

// Check file permissions of upload directory
$uploadDir = 'uploads/';
if (!is_writable($uploadDir)) {
    echo 'Upload directory is not writable';
}