Audience: WordPress users, website administrators.
Problem: When importing a WordPress theme demo or a large XML file, the process fails with an error message like “It seems there is a configuration issue with your server that’s causing the import to fail,” “The connection was reset,” or “Maximum execution time exceeded.”
Cause: This error almost always indicates that the import process is exceeding the resource limits set by your hosting server’s configuration. WordPress is built on PHP, and by default, PHP has strict limits on how long a script can run (max_execution_time
), the size of files you can upload (upload_max_filesize
), and the total amount of data that can be sent in a single request (post_max_size
). Demo imports often involve large files and long processing times, which hit these limits and cause the server to terminate the process.
To fix this, you need to increase these PHP values.
Recommended Server Values for Imports
Before you begin, here are the settings we recommend for a smooth import process.
Directive | Purpose | Recommended Value |
---|---|---|
upload_max_filesize | The maximum size of a single file that can be uploaded. | 128M |
post_max_size | The maximum size of all data sent in a request. Must be larger than or equal to upload_max_filesize. | 128M |
max_execution_time | The maximum time in seconds a script is allowed to run before it's terminated. | 300 |
memory_limit | The maximum amount of memory a script can consume. | 256M |
max_input_vars | The maximum number of variables a script can use. Important for saving theme options. | 3000 |
Resolution Methods
Here are four common methods to increase your PHP limits, ordered from easiest to most advanced. If one doesn’t work, proceed to the next.
Important: Before making any changes, it is highly recommended to back up your website files.
Method 1: Use Your Hosting Control Panel (The Easiest Way)
Most modern hosting providers (especially those using cPanel or Plesk) provide a user-friendly interface to modify these settings without touching any code.
Log in to your hosting account’s control panel.
Look for a tool named “MultiPHP INI Editor,” “Select PHP Version,” or “PHP Configuration.”
In this tool, you will see a list of PHP directives.
Find and adjust the values for
max_execution_time
,upload_max_filesize
,post_max_size
, andmemory_limit
to the recommended values listed above.Save your changes. The server will apply them automatically. This is the safest and most reliable method.
(Note: Your interface may look different)
Method 2: Edit the .htaccess
File
If you don’t have access to a PHP editor in your control panel, you can often add the directives to your .htaccess
file.
Connect to your server using an FTP client (like FileZilla) or your host’s File Manager.
Navigate to the root directory of your WordPress installation (where
wp-config.php
is located).Locate the
.htaccess
file. (If you can’t see it, ensure you have enabled “Show Hidden Files.”)Add the following lines of code to the very bottom of the file:
php_value upload_max_filesize 128M
php_value post_max_size 128M
php_value max_execution_time 300
php_value memory_limit 256M
php_value max_input_vars 3000
Save the file and try the import again.
Method 3: Edit the wp-config.php
File
While less common for these specific directives, you can increase the memory limit and execution time within your WordPress configuration file.
Locate the
wp-config.php
file in your WordPress root directory.Open the file and add the following lines just before the line that says
/* That's all, stop editing! Happy publishing. */
.
define('WP_MEMORY_LIMIT', '256M');
set_time_limit(300);
Save your changes.
Method 4: Create or Edit a php.ini
or .user.ini
File
This is a powerful method, typically available on VPS or dedicated hosting. Some shared hosts also allow it using a file named .user.ini
.
Check your root directory for a file named
php.ini
or.user.ini
. If one exists, you can edit it.If not, create a new file named
.user.ini
in your WordPress root directory.Add the following code to the file:
upload_max_filesize = 128M
post_max_size = 128M
max_execution_time = 300
memory_limit = 256M
max_input_vars = 3000
Save the file and re-attempt the import.
What If It Still Fails? Contact Your Host
If you have tried all the methods above and the import still fails, it means your hosting provider has server-level restrictions that prevent you from overriding the PHP settings.
At this point, you must contact your hosting provider’s support team.
Simply send them a message like this:
“Hello, I am trying to import a theme demo file into my WordPress site, but the process is failing due to server resource limits. Could you please increase the following PHP values for my account to the recommended levels?
upload_max_filesize
to128M
post_max_size
to128M
max_execution_time
to300
seconds
memory_limit
to256M
max_input_vars
to3000
Thank you.”
They will be able to adjust these settings for you, which should resolve the import issue permanently.