本文介绍了DoDirectPayment失败:无法连接到主机(7)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用来自PHP的Paypal示例代码 cms.paypal/us/cgi-bin/?cmd = _render-content& content_ID = developer/library_code
I am using the sample code of paypal in php from cms.paypal/us/cgi-bin/?cmd=_render-content&content_ID=developer/library_code
但是每当我运行此示例代码时,我都会收到此错误.
but whenever i am running this sample code i am getting this error.
"DoDirectPayment失败:无法连接到主机(7)"
"DoDirectPayment failed: couldn't connect to host(7)"
我不知道出了什么问题.
I have no clue what's the problem.
注意:我正在使用本地WAMP服务器来运行此示例.
Note: I am using local WAMP server for running this sample.
推荐答案// Set the curl parameters. - $ch = curl_init(); curl_setopt($ch, CURLOPT_PROXY, " username:password@proxyserver:port/";); curl_setopt($ch, CURLOPT_URL, $API_Endpoint); curl_setopt($ch, CURLOPT_VERBOSE, 1); // Turn off the server and peer //verification(TrustManager Concept). curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); //The rest of the code from paypal site
更多推荐
DoDirectPayment失败:无法连接到主机(7)
发布评论