Static WordPress Community

Cannot deploy to Netlify: 405 error. But increasing max_execution_limit does nothing

I’m running WP2Static Version 7.1.6 (master branch) on LocalWP on my PC.

When trying to deploy to Netlify using the WP2Static Netlify plugin, I get a 405 error alert. It tells me to increase the max_execution_limit in PHP.

I have bumped that, and the memory limit for good measure, but it doesn’t fix the problem.

This is what I am using in wp-config to increase memory and execution limit:

define( 'WP_MEMORY_LIMIT', '200000M' );

I am also using this in htaccess for same effect:

php_value memory_limit 200000M
php_value max_execution_time 3000000

This is the error am seeing in my server logs:

2021/08/31 10:26:17 [error] 7368#4304: *42 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while reading response header from upstream, client:, server: , request: “POST /wp-admin/admin-ajax.php HTTP/1.0”, upstream: “fastcgi://”, host: “agentcakecom.local”, referrer: “http://agentcakecom.local/wp-admin/admin.php?page=wp2static

And these are the logs from within WP2Static:

2021-08-31 10:36:35: Error while retrieving URL: http://agentcakecom.local/
2021-08-31 10:26:35: Using CrawlCache.
2021-08-31 10:26:35: Starting to crawl detected URLs.
2021-08-31 10:26:35: Starting crawling
2021-08-31 10:26:35: URL detection completed (1734 URLs detected)
2021-08-31 10:26:35: Detection complete. 1734 URLs added to Crawl Queue.
2021-08-31 10:06:18: Starting to detect WordPress site URLs.
2021-08-31 10:06:18: Starting URL detection
2021-08-31 10:06:18: Running WP2Static in Headless mode
2021-08-31 10:06:18: Running full workflow from UI

Any idea what’s going on?

Hi @TurningWheel,

Hmm, can you send me a bit more info about your local hosting setup?

If you can, try running a copy of your site in Lokl, which is optimized for WP2Static and I can reproduce any issue you find there more easily.

You could also try a similar deploy on your current setup, but with an empty WP site, default theme, no other plugins, etc. In an attempt to isolate the cause here (environment, theme/plugin, site content)

Hi, thanks for the help.

Here’s some more details of the setup:

  1. Local server setup: Nigix Web Server, PHP 7.3.5, MySQL 8.0.16
  2. I’m running LocalWP ( version 6.1.1+5468 on Windows 10 version 1909.
  3. WordPress version 5.8

These are other steps I have tried to resolve it:

First up, I tried also increasing limits via php.ini to make sure all vectors for that fix were covered. Didn’t help unfortunately.

Then I created a new blank site on LocalWP, upgraded it to WordPress 5.8, installed WP2Static and WP2Static Zip plugins. Configured WP2Static to create a zip, and ran it. It had the same problems. Increasing the memory and timeouts also doesn’t fix it for the blank site.

I don’t really want to switch away from using LocalWP if I can avoid it. I really like it’s features/addons (Live Links, Image Optim, Backups, etc).

But for purposes of testing to expose the bug I tried to install Lokl on my PC. But it won’t install. I made sure Docker and cURL are installed. When running sh -c "$(curl -sSl '')" via Command Prompt it says 'sh' is not recognized as an internal or external command, operable program or batch file.


I’m using an old shitty low end laptop at the moment because my Macbook is getting repaired. Had a feeling the power behind the laptop could be the problem, so I borrowed my friends Macbook to run the deployment, and it’s working fine now.

So you can probably close this off if you want - unless you care about optimizing for low end laptops!

Thanks for the update, @TurningWheel!

I think the issue lies somewhere around Windows and LocalWP - I assume you’re using LocalWP on your mac, too.

The difference is that LocalWP uses the system’s underlying components/installs some vs virtualizing a web server (which I believe they used to on Windows).

Majority of world’s webservers are Linux/UNIX/BSD based vs Windows and my testing on Windows has been sporadic at best. I should really improve it, seeing as there’s plenty of Windows users who would like to host local WP sites and deploy statically, but I tend to steer them towards some virtualization option, to get Linux running inside Windows.

The missing part for Lokl on Windows is some kind of shell, like Git Bash or WSL - even with cURL and Docker, I don’t think it will have the requisite shell commands to drive them, as we have on mac and Linux.

Glad you’re back up and running and sorry for the headaches along the way!