我有一个在MAMP (macos)上本地运行的站点,当我使用cURL时一直会得到wp_remote_get()
错误
我已经搜索并尝试过多种解决方案,但似乎没有任何效果。
我的代码:
$url = site_url() . '/wp-json/wp/v2/my-cpt'; // This works just fine and shows up in the browser correctly
$response = wp_remote_get( $url ); // this outputs the cURL error: "cURL error 60: SSL certificate problem: unable to get local issuer certificate"
我有:
https://curl.haxx.se/docs/caextract.html
发布于 2021-01-13 17:36:40
这更像是当地的工作。您可以在本地站点中禁用SSL验证。这可以通过将这一行添加到文件wp-includes/functions.php
或/wp-content/themes/YOUR_THEME/functions.php
来实现。
add_filter('https_ssl_verify', '__return_false');
https://stackoverflow.com/questions/63969700
复制相似问题