How do I install cURL on cygwin?

I just encountered this. 1) Find the cygwin setup.exe file from http://cygwin.com/ and run it. 2) Click/enter preferences until you reach the “Select Packages” window. (See image) 3) Click (+) for Net 4) Click the entry for curl. (Make sure you select the checkbox for the Binary) 5) Install. 6) Open a cygwin window and … Read more

PHP CURL CURLOPT_SSL_VERIFYPEER ignored

According to documentation: to verify host or peer certificate you need to specify alternate certificates with the CURLOPT_CAINFO option or a certificate directory can be specified with the CURLOPT_CAPATH option. Also look at CURLOPT_SSL_VERIFYHOST: 1 to check the existence of a common name in the SSL peer certificate. 2 to check the existence of a … Read more

RAW POST using cURL in PHP

I just found the solution, kind of answering to my own question in case anyone else stumbles upon it. $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, “http://url/url/url” ); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt($ch, CURLOPT_POST, 1 ); curl_setopt($ch, CURLOPT_POSTFIELDS, “body goes here” ); curl_setopt($ch, CURLOPT_HTTPHEADER, array(‘Content-Type: text/plain’)); $result = curl_exec($ch);

Get final URL after curl is redirected

curl‘s -w option and the sub variable url_effective is what you are looking for. Something like curl -Ls -o /dev/null -w %{url_effective} http://google.com More info -L Follow redirects -s Silent mode. Don’t output anything -o FILE Write output to <file> instead of stdout -w FORMAT What to output after completion More You might want to … Read more

How can I find where I will be redirected using cURL in PHP?

To make cURL follow a redirect, use: curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); Erm… I don’t think you’re actually executing the curl… Try: curl_exec($ch); …after setting the options, and before the curl_getinfo() call. EDIT: If you just want to find out where a page redirects to, I’d use the advice here, and just use Curl to grab the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)