Php 本地WordPress&;MAMP wp_remote_get():cURL错误60:SSL证书问题:无法获取本地颁发者证书
我有一个在MAMP Pro(macos)上本地运行的站点,当我使用Php 本地WordPress&;MAMP wp_remote_get():cURL错误60:SSL证书问题:无法获取本地颁发者证书,php,wordpress,ssl,curl,mamp,Php,Wordpress,Ssl,Curl,Mamp,我有一个在MAMP Pro(macos)上本地运行的站点,当我使用wp\u remote\u 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
wp\u remote\u 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"
我有:
这更像是一项本地工作。您可以在本地站点中禁用SSL验证。这可以通过将此行添加到文件
wp includes/functions.php
或
/wp content/themes/YOUR_THEME/functions.php
add_filter('https_ssl_verify', '__return_false');
这更像是一项本地工作。您可以在本地站点中禁用SSL验证。这可以通过将此行添加到文件
wp includes/functions.php
或
/wp content/themes/YOUR_THEME/functions.php
add_filter('https_ssl_verify', '__return_false');
瑞安·多恩,你找到解决办法了吗?我也有同样的问题Ryan Dorn你找到解决办法了吗?我也有同样的问题。