Closed jdevalk closed 1 month ago
I don't think I'm providing any new info here, but wanted to chime in that I have the same issue when adding a blueprint for SimplyRETS. We use curl
when available or fall back to file_get_contents
.
cURL isn't enabled and file_get_contents()
returns the following error:
Warning: file_get_contents(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /wordpress/wp-content/plugins/simply-rets/simply-rets-api-helper.php on line 287
Warning: file_get_contents(https://...<url>): Failed to open stream: no suitable wrapper could be found in /wordpress/wp-content/plugins/simply-rets/simply-rets-api-helper.php on line 287
Really cool work so far though, I'm looking forward to this support.
With my plugin, which also needs CuRL, I get a different message:
PHP Fatal error: Uncaught Error: Call to undefined function Imdb\curl_init() in /wordpress/wp-content/plugins/lumiere-movies/vendor/jcvignoli/imdbphp/src/Imdb/Request.php:37
Seems like php extension CuRL is missing.
Libcurl and stream wrappers are indeed not supported at the moment. This issue explores the challenge:
https://github.com/WordPress/wordpress-playground/issues/85
To bring some good news, I got a basic file_get_contents("https://mysite.com")
support to work in https://github.com/WordPress/wordpress-playground/pull/1051, and the technique used would unblock libcurl support, too. Note that PR is focused on another topic and needs a lot of cleaning up as it's an amalgamate of many different explorations.
I've extracted the HTTPS support, which is a pre-requisite to supporting libcurl, to a separate PR where it can be discussed and iterated on https://github.com/WordPress/wordpress-playground/pull/1093.
Yeah, we're going to need libcurl too for heavy adoption in WPVIP.
@mhsdef libcurl is supported in Playground CLI now, we'll update this issue once it's also available in the browser.
Curl is available in web browsers since https://github.com/WordPress/wordpress-playground/pull/1935. I've confirmed the https://wordpress.org/plugins/plausible-analytics/ plugin installs cleanly – although that might also be thanks to their work after @jdevalk reported the crash. Either way, curl is in place! The typical web CORS limitations apply as all network calls are handled using fetch()
– to solve for that in the medium term, we're figuring out a generalized CORS proxy for Playground.
When you try to use the Plausible WordPress plugin on the WordPress playground, you get the following fatal error:
With networking enabled, maybe
allow_url_fopen
should betrue
?I've also filed an issue with Plausible who should catch this fatal error.