Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/258.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
当PHP curl_setopt_数组';这是假的吗?_Php_Curl - Fatal编程技术网

当PHP curl_setopt_数组';这是假的吗?

当PHP curl_setopt_数组';这是假的吗?,php,curl,Php,Curl,代码: 我需要弄清楚这些卷曲选项出了什么问题。如何调试curl\u setopt\u array()本身?由于cookiejar是一个(经过测试的)工作文件名,url是正确的,header函数正在工作,并且每个其他选项都是硬编码的,我应该做些什么来深入挖掘呢?调试时应该使用复数curl\u setopt而不是单数curl\u setopt\u array <?php $this->curlHandle = curl_init(); $curl_options = $th

代码:



我需要弄清楚这些卷曲选项出了什么问题。如何调试
curl\u setopt\u array()
本身?由于cookiejar是一个(经过测试的)工作文件名,url是正确的,header函数正在工作,并且每个其他选项都是硬编码的,我应该做些什么来深入挖掘呢?

调试时应该使用复数
curl\u setopt
而不是单数
curl\u setopt\u array

<?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);
?>