Skip to main content
The “Upload failed” error appears when MainWP cannot transfer plugin or theme files from your Dashboard to child sites. This is typically caused by server configuration, security settings, or localhost limitations.

What You’ll Learn

  • Identify the cause of upload failures
  • Check server configuration requirements
  • Resolve security rule conflicts
  • Understand localhost limitations

Prerequisites

  • MainWP Dashboard installed and activated
  • Admin access to your Dashboard site
  • Access to server configuration (or hosting support)

Check Server Configuration

PHP tmpfile() Function

The tmpfile() PHP function is required for processing file uploads. If disabled, uploads fail.
1

Check Server Information

Go to MainWP > Info > Server and look for disabled PHP functions.
2

Contact hosting if needed

If tmpfile() is disabled, contact your hosting provider to enable it.

File Size Limits

Your server must allow uploads large enough for plugin and theme .zip files.
SettingRecommended ValueWhere to Check
upload_max_filesize64M or higherMainWP > Info > Server
post_max_size64M or higherMainWP > Info > Server
max_execution_time300 secondsMainWP > Info > Server
If these values are too low, contact your hosting provider or modify php.ini.

Check Security Rules

Security configurations can block the upload process. Try these steps in order.

.htaccess Rules

1

Review .htaccess

Check the .htaccess file in your Dashboard’s WordPress directory for security rules that might block uploads.
2

Temporarily rename

Rename .htaccess to .htaccess.backup to test if it’s causing the issue.
3

Test upload

Attempt the plugin/theme upload again.
4

Restore or modify

If uploads work, restore .htaccess and adjust the specific rule causing the block.

Security Plugins

Security plugins on your Dashboard can interfere with upload processes.
1

Temporarily disable

Deactivate security plugins on your Dashboard site (not child sites).
2

Test upload

Attempt the upload again.
3

Identify conflict

If successful, re-enable plugins one by one to find the conflicting one.
4

Configure exception

In the conflicting plugin, add an exception for MainWP operations.

Server Firewall

Your hosting provider’s firewall may block the connection.
  • Contact hosting support to check firewall logs
  • Request whitelisting for your Dashboard’s internal processes
  • Verify that ModSecurity or similar WAF isn’t blocking uploads

HTTP Basic Authentication

If your Dashboard is protected by HTTP Basic Auth (.htpasswd), uploads may fail.
1

Temporarily disable

Remove HTTP Basic Auth protection from your Dashboard URL.
2

Test upload

Attempt the upload.
3

Re-enable if needed

After confirming uploads work, consider alternative security measures that don’t interfere with MainWP.

Localhost Limitations

If your MainWP Dashboard runs on a local development environment (localhost), child sites on remote servers cannot connect back to receive files.

Why This Happens

  • Localhost is not accessible from the internet
  • Child sites cannot reach your local Dashboard to download files
  • The upload process requires two-way communication

Solutions for Localhost

OptionDescription
Use a tunnelTools like ngrok expose localhost to the internet temporarily
Upload directlyInstall plugins/themes directly on child sites for testing
Use stagingTest with a publicly accessible staging Dashboard

Self-Check Checklist

  • PHP tmpfile() function is enabled
  • upload_max_filesize is adequate
  • .htaccess doesn’t block uploads
  • Security plugins temporarily disabled for testing
  • HTTP Basic Auth disabled (if applicable)
  • Dashboard is publicly accessible (not localhost)
  • Uploads complete successfully