Possible Duplicate:
mysql_fetch_array() expects parameter 1 to be resource, boolean given in select捲曲SETOPT無法正常工作
我的工作是進口MLS掛牌數據的PHP腳本。當我通過CLI執行腳本時,出現以下錯誤:
PHP警告:curl_setopt()期望參數1是/ var/www/clients/client4/web4/web/wp-content /插件/ import-rets/RETS_class.php在線283 PHP警告:curl_exec()期望參數1是資源,字符串在/ var/www/clients/client4/web4/web/wp-content/plugins/PHP警告:curl_error()需要參數1爲資源,字符串在/ var/www/clients/client4/web4/web/wp-content/plugins/import-rets/RETS_class中給出。 PHP在線287 PHP警告:curl_getinfo()期望參數1是資源,字符串在/var/www/clients/client4/web4/web/wp-content/plugins/import-rets/RETS_class.php在295行中給出 PHP Wa rning:curl_close()期望參數1是資源,字符串在/var/www/clients/client4/web4/web/wp-content/plugins/import-rets/RETS_class.php在線191 PHP Warning:curl_setopt( )期望參數2很長,數組在/var/www/clients/client4/web4/web/wp-content/plugins/import-rets/RETS_class.php在線283 PHP警告:curl_setopt()期望參數2長,數組中/var/www/clients/client4/web4/web/wp-content/plugins/import-rets/RETS_class.php給出線283
這裏是我的代碼:
if (!$this->user_agent_auth) {
$options[CURLOPT_HTTPAUTH] = CURLAUTH_DIGEST|CURLAUTH_BASIC;
$options[CURLOPT_USERPWD] = $this->account.":".$this->password;
} elseif ($this->exec_count <> 1) {
$options[CURLOPT_HTTPAUTH] = CURLAUTH_DIGEST;
$options[CURLOPT_USERPWD] = $this->account.":".$this->password;
}
curl_setopt($this->ch, $options, $value);
$response = curl_exec($this->ch);
$error = curl_error($this->ch);
if ($error != '') {
$this->response['curl_error'] = $error;
$this->response['request_header'] ='';
$this->response['received_header']='';
$this->response['received_body'] ='';
$this->response['http_code'] ='';
} else {
$this->response = curl_getinfo($this->ch);
$this->response['curl_error'] = '';
$this->response['received_header'] = substr($response, 0, $this->response['header_size']);
$this->response['received_body'] = substr($response, $this->response['header_size']);
}
$this->response['data'] = $data;
任何支持,將不勝感激。
可以粘貼var_dump($ this-> ch)的輸出 – Scuzzy
在單獨的文件中還是同一個文件中? – user1249318