• I am using PHP 7.2.x version and WP 5.8.1.
    all the curl, file related libraries are in place.
    but none of the scripts related to file_get_contents(), curl or wp_remote_get aren’t working.

    when used wp_remote_get getting following error – WP_Error Object ( [errors] => Array ( [http_request_failed] => Array ( [0] => cURL error 7: ) )

    When using CURL, curl info is coming as follows without any errors :- Array ( [url] => feedurl?token [content_type] => [http_code] => 0 [header_size] => 0 [request_size] => 0 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 0.002587 [namelookup_time] => 0.002671 [connect_time] => 0 [pretransfer_time] => 0 [size_upload] => 0 [size_download] => 0 [speed_download] => 0 [speed_upload] => 0 [download_content_length] => -1 [upload_content_length] => -1 [starttransfer_time] => 0 [redirect_time] => 0 [redirect_url] => [primary_ip] => [certinfo] => Array ( ) [primary_port] => 0 [local_ip] => [local_port] => 0 )

    Can someone please help me to fix these issues and make it working.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    WordPress is not blocking you, so this is likely a problem with your host. They may be blocking outgoing connections. Please ask them about this possibility.

    Thread Starter arunasrim

    (@arunasrim)

    Hi @sterndata,
    Thanks for your response.
    But we tried executing the same CURL script out side of the WordPress application in a standalone PHP file. request is successful and we got response aswell.

    But it isn’t working in WordPress template, also I see REST API Curl Error 7 under dashboard level WordPress events and news. is it any way related to the PHP version and WordPress compatability related issue?

    • This reply was modified 2 years, 10 months ago by arunasrim.
    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Please test with PHP 7.4 and WP 5.9.3.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘CURL Error 7’ is closed to new replies.