0

Install module wordpress-rest-api-client Magento 2.4.5

https://github.com/varsitynewsnetwork/wordpress-rest-api-client

Error 1:

  • vnn/wordpress-rest-api-client 1.3.0 requires php ^7.0 -> your php version (8.1.3) does not satisfy that requirement.

Error 2:

cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://novedades.pcarts.com//wp-json/wp/v2/posts?categories%5B0%5D=36&orderby=date&order=desc&per_page=5&page=1&image_display=1&image_size=medium_large

1 Answer 1

1

Solutions:

Error 1: -ignore-platform-reqs

warp composer vnn/wordpress-rest-api-client --ignore-platform-reqs install

Or in file composer.json

Change: "require": {"php": "^7.0"}, to "require": {"php": "^7.1 || ^8.0"}

Error 2: create patch

Create file m2-hotfixes/wordpress-errorssl.patch

--- a/vendor/vnn/wordpress-rest-api-client/src/Http/GuzzleAdapter.php
+++ b/vendor/vnn/wordpress-rest-api-client/src/Http/GuzzleAdapter.php
@@ -43,6 +43,6 @@
      */
     public function send(RequestInterface $request)
     {
-        return $this->guzzle->send($request);
+        return $this->guzzle->send($request,['verify' => false]);
     }
 }

In Console:

php ./vendor/bin/ece-patches apply

Or

php ./vendor/bin/ece-tools patch

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.