doulu8537
2016-08-12 17:12
浏览 222
已采纳

PHP7 CurlFile不存在,我已经把它放了

$postdata = array(
                    'method'    => 'post',
                    'key'       => $apikey,
                    'file'      => new \CurlFile($filename,'image/jpg'),
                    'phrase'        => $is_phrase,
                    'regsense'      => $is_regsense,
                    'numeric'       => $is_numeric,
                    'min_len'       => $min_len,
                    'max_len'       => $max_len,
                            'is_russian'    => $is_russian
                );
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL,             "http://$domain/in.php");
curl_setopt($ch, CURLOPT_RETURNTRANSFER,     1);
curl_setopt($ch, CURLOPT_TIMEOUT,             60);
curl_setopt($ch, CURLOPT_POST,                true);
curl_setopt($ch, CURLOPT_POSTFIELDS,         $postdata);
$result = curl_exec($ch);

The result response is:

Uncaught Error: Class 'CurlFile' not found in ...

Im running on PHP7.

So why?

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • drgzmmy6379 2016-08-12 17:26
    已采纳

    The curl plugin should be properly installed. The same can be verified using phpinfo()

    打赏 评论

相关推荐 更多相似问题