Open BenJackGill opened 2 years ago
I fixed this by downgrading from PHP 7.4.1 to PHP 7.3.5.
It now works with Local WP.
Update: This issue is still ongoing.
I have just tested PHP 7.4.3 and it looks like that version is also working on LocalWP.
Other PHP versions above this (8.0.22 and 8.1.9) will show debugging errors inside WordPress under the WP2Static > Caches tab. So I would avoid using those versions.
Side note: If you are on a Mac you also have to accept the LocalWP SSL certificate manually. In LocalWP open up your site and click "Trust" next to SSL. Then on your Mac go to "Keychain Access" and you will see a certificate for a matching domain name (the domain name of the site you just trusted in LocalWP). It will have a red "X" next to it. Double click that, open the "trust" section, and change "When using this certificate" to "Always Trust". The restart your site in LocalWP. Doing that AND using the correct PHP version as advised above will remove the error.
Likely issue: Environmental
Describe the bug I am running wp2static locally using Local WP.
When clicking the "Generate static site" button it returns this error in the browser:
My current
max_execution_time
limit is12000
so that is not the problem. Also the browser console only saysFailed to load resource: the server responded with a status of 500 ()
so that is not very helpful.But the PHP logs have this interesting stack trace:
The interesting part is this line showing a
cURL error 60
for WP2Static Guzzle:I did some further digging and found a similar issue here on the Local WP support forums. The developers of Local WP says the issue is because the plugin is using
Guzzle
and crafting it's own HTTP requests without using the built-in WP functions. If the requests were refactored the plugin could benefit from the fallbacks and guarding that WP comes with.I have also tested this issue by using the site with Lando and it does not have the same problem. So think the issue resides with how the enviroment (i.e. Local WP) handles cert issues. But if wp2static used the built-in WP functions for the request it wouldn't have the same problems.
To Reproduce Steps to reproduce the behaviour:
Expected behaviour No error and site is uploaded to Netlify
Environment (please complete the following information):