4

I am getting following error in WooCommerce USPS Shipping Plugin:"

USPS REQUEST FAILEDcURL error 5: Could not resolve proxy: http_proxy

Can someone please help with on how to resolve this?

I googled it but could not find anything related.

James Jones
  • 3,850
  • 5
  • 25
  • 44
meetpd
  • 9,150
  • 21
  • 71
  • 119

1 Answers1

1

In cURL documentation the code 5 means that a proxy server cannot be resolved (it cannot be reached in a DNS query):

CURLE_COULDNT_RESOLVE_PROXY (5)

Couldn't resolve proxy. The given proxy host could not be resolved.

The WF_Shipping_USPS class in the plugin source uses wp_remote_post() to communicate with the USPS API. I think you have something wrong in configuration for proxy and/or have the "http_proxy" defined as string in some config file or even at the environment vars in Linux.

You can check wp-config.php for the lines (just a sample config, you data may be different):

/* Configure proxy Server */
define('WP_PROXY_HOST', 'www-cache.leeds.ac.uk');
define('WP_PROXY_PORT', '3128');
define('WP_PROXY_USERNAME', '');
define('WP_PROXY_PASSWORD', '');
define('WP_PROXY_BYPASS_HOSTS', 'localhost');

If your server is linux, you can try:

echo $HTTP_PROXY

And see if there are something here that is wrong.

To me somewhere you have the string "http_proxy" configured as a proxy host. If you have a proxy correct this by putting the right config. If you do not have a proxy, remove this string and try to disable proxy usage for Wordpress.

Holzhey
  • 381
  • 2
  • 8