I am experiencing a persistent 502 Bad Gateway error when trying to import the demo content for my WordPress theme.
The issue occurs every time I run the theme’s Demo Data Import tool. The process starts, but after a short period, it fails with the 502 error, which points to a proxy/server timeout issue.
What I have already tried (Troubleshooting steps):
Increased PHP Limits: I have manually increased the PHP limits in my wp-config.php file, setting WP_MEMORY_LIMIT to 256M and max_execution_time to 300 seconds.
Checked other plugins: I have tried disabling other plugins, but the error persists during the long-running import process.
Given that the PHP limits have been increased, I suspect this issue is related to the proxy/firewall timeout limits set on the InfinityFree server, which is cutting off the connection prematurely due to the heavy nature of the import script.
Could an administrator please check my hosting account to see if the server proxy timeout can be temporarily adjusted, oer if there is another server-side limit that is causing this 502 error specifically during the demo import?
Please note that the PHP max_execution_time and memory_limit are not user configurable. Note that the memory_limit is already 512 MB, so setting it to 256 MB is reducing it.
The PHP max_execution_time is 60 seconds, and the server also terminates the request after 60 seconds. So that’s the limit, and it cannot be increased.
It’s likely that the demo import takes more than 60 seconds to process. If so, your only option is to find an alternative way to get the demo content in there. Maybe it’s possible to import the content in chunks, or import them in some other way than uploading it through the web interface.
Thank you very much for your quick and clear explanation regarding the server limitations.
I understand that the strict 60-second execution time limit (enforced by the server proxy) is non-negotiable and is the cause of the 502 Bad Gateway error during the demo import.
I will follow your advice and look for an alternative method to import the content manually, most likely by splitting the theme’s demo XML file into smaller chunks to avoid hitting the 60-second limit.
Thank you again for confirming the technical constraints of the hosting environment.