Phpcurl_execwindow, linux

Source: Internet
Author: User
Phpcurl_execwindow, linux $ ch = curl_init ();
$ Header = "Accept-Charset: UTF-8 ";
Curl_setopt ($ ch, CURLOPT_URL, $ url );
Curl_setopt ($ ch, CURLOPT_CUSTOMREQUEST, "POST ");
Curl_setopt ($ ch, CURLOPT_SSL_VERIFYPEER, FALSE );
Curl_setopt ($ ch, CURLOPT_SSL_VERIFYHOST, FALSE );
Curl_setopt ($ ch, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1 );
Curl_setopt ($ curl, CURLOPT_HTTPHEADER, $ header );
Curl_setopt ($ ch, CURLOPT_USERAGENT, 'mozilla/5.0 (compatible; MSIE 5.01; Windows NT 5.0 )');
Curl_setopt ($ ch, CURLOPT_FOLLOWLOCATION, 1 );
Curl_setopt ($ ch, CURLOPT_AUTOREFERER, 1 );
Curl_setopt ($ ch, CURLOPT_POSTFIELDS, $ data );
Curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, true );
$ TmpInfo = curl_exec ($ ch );
This is my code. there is no problem during execution on the local machine. The Windows 64-bit operating system on the local machine prompts an unknown error code or an unknown error when accessing the local machine through the server, the server is a linux system.


Reply to discussion (solution)

Windows and linux are different.

Windows and linux are different.


It is estimated that it is a problem with the linux curl version. let's take a look.

Who prompts: Unknown error number, unknown error ???
Apparently not php

Where is the error prompted?

Who prompts: Unknown error number, unknown error ???
Apparently not php



An error is prompted when $ tmpInfo = curl_exec ($ ch); is executed.

Where is the error prompted?



An error is prompted when $ tmpInfo = curl_exec ($ ch); is executed. Then I re-installed a version of curl7.44.

Php will not give such information!
If this is true, it is clearly the information returned by your target address.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.