0

Code:

<?php
  $this->curlHandle = curl_init();

  $curl_options = $this->additionalCurlOptions + array(
    CURLOPT_COOKIEJAR => $this->cookieFile,
    CURLOPT_URL => $base_url,
    CURLOPT_FOLLOWLOCATION => TRUE,
    CURLOPT_MAXREDIRS => 5,
    CURLOPT_RETURNTRANSFER => TRUE,
    CURLOPT_SSL_VERIFYPEER => FALSE, // Required to make the tests run on https.
    CURLOPT_SSL_VERIFYHOST => FALSE, // Required to make the tests run on https.
    CURLOPT_HEADERFUNCTION => array(&$this, 'curlHeaderCallback'),
  );
  if (isset($this->httpauth_credentials)) {
    $curl_options[CURLOPT_USERPWD] = $this->httpauth_credentials;
  }

  // curl_setopt_array() returns FALSE if any of the specified options
  // cannot be set, and stops processing any further options.
  $result = curl_setopt_array($this->curlHandle, $this->additionalCurlOptions + $curl_options);
?>

I need to figure out what's going wrong with those curl options. How to debug the curl_setopt_array() itself? Since the cookiejar is a (tested) working filename, url is correct, the header function is working, and every other option is hard-coded, what should i do to dig deeper?

1 Answer 1

1

You should use plural curl_setopt instead of singular curl_setopt_array for debugging.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.