You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Error code 500 returned from server.
Please check your sever's error logs or try increasing your max_execution_time limit in PHP if this consistently fails after the same duration.
More information of the error may be logged in your browser's console.
My current max_execution_time limit is 12000 so that is not the problem. Also the browser console only says Failed 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:
PHP Fatal error: Uncaught WP2StaticGuzzleHttp\Exception\RequestException: cURL error 60: SSL certificate problem: self signed certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://asiaaspect.local//sitemap.xml in /Users/BenJackGill/Local Sites/asiaaspect/app/public/wp-content/plugins/wp2static/vendor/leonstafford/wp2staticguzzle/src/Handler/CurlFactory.php:211
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:
Download Local WP and create a new site with wp2static and wp2static Netlify plugins installed
Click on WP2static > Run > Generate Static Site
See error
Expected behaviour
No error and site is uploaded to Netlify
Environment (please complete the following information):
Hosting OS: MacOs Monterey version 12.4
Web server setup: Local WP version 6.4.0 / PHP 7.4.1 / MySQL 8.0.16 / WordPress Version 6.0
Hosting company: Local computer
The text was updated successfully, but these errors were encountered:
BenJackGill
changed the title
Error 500 when generating site on LocalWP - PHP error: cURL error 60: SSL certificate problem: self signed certificate
Error 500 when generating site on LocalWP. Also PHP error: cURL error 60: SSL certificate problem: self signed certificate
Jun 14, 2022
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):
The text was updated successfully, but these errors were encountered: