If you encounter an HTTP Error (Error-200) during media file uploads or the message “Failed to write file to disk”, these indicate server configuration or permission issues that need to be addressed.
Resolving HTTP Error (Error-200)
This error is related to server execution limits when uploading files in WordPress.
Solution:
- Open wp-config.php in your sites main directory via FTP (or cPanel)
- Scroll to the line which reads
/* That’s all, stop editing! Happy blogging. */
- Add the code
set_time_limit(60);
above the line/* That’s all, stop editing! Happy blogging. */
text - Set the set_time_limit(300);
Important Notes:
Some hosting providers may restrict changing the execution time via wp-config.php.
In such cases, consult your hosting provider for adjustments.
For best results, also review your hosting configuration and consider increasing related PHP settings (if possible), such as:
- max_execution_time
- upload_max_filesize
- post_max_size
Some hosting companies may not allow you to overwrite this setting from wp-config. However, you can still try.
Reference:
For additional details on increasing limits:
https://wordpress.mcdspot.com/2012/03/20/ways-to-increase-max-file-upload-size-and-execution-time/
Resolving “Failed to Write File to Disk”
This error occurs when WordPress is unable to write uploaded files to the server, often due to incorrect folder permissions or insufficient server disk space.
Solution:
Check Upload Folder Permissions
- Access your site via FTP or cPanel.
- Navigate to the wp-content/uploads directory.
- Ensure the folder has correct permissions: Recommended: 755
- If needed for troubleshooting: 777 (use with caution and revert to 755 once the issue is resolved)
Reference:
https://wordpress.org/documentation/article/changing-file-permissions/
Check Disk Space
- Verify with your hosting provider that your hosting account has sufficient disk space.
- If disk usage is near or at capacity, you may need to upgrade your hosting plan.