SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Apr 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Wrong parameter count for curl_exec()

    Hi folks,

    I'm using the following code to retrieve an external RSS file on a webhost that doesn't support fopen().

    Code:
    $ch = curl_init();
    curl_setopt ($ch, CURLOPT_HTTPPROXYTUNNEL, TRUE);
    curl_setopt ($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
    curl_setopt ($ch, CURLOPT_PROXY, 'http://64.202.165.130:3128');
    curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
    curl_setopt ($ch, CURLOPT_URL, 'http://www.rollingstone.com/rssxml/music_news.xml');
    $data = curl_exec();
    curl_close($ch);
    I get a webpage error:
    Code:
    Warning: Wrong parameter count for curl_exec() in ... on line 62
    which corresponds to
    Code:
    $data = curl_exec();
    I've been told my my web host the only way to grab an external file:

    You will need to use our proxy server in order to grab data from an
    external website, and only if that site uses port 80 or 443. If you are
    using cURL, here's the script to do so:

    curl_setopt ($ch, CURLOPT_HTTPPROXYTUNNEL, TRUE);
    curl_setopt ($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
    curl_setopt ($ch, CURLOPT_PROXY, http://64.202.165.130:3128);
    curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
    I've simply added:
    Code:
    curl_setopt ($ch, CURLOPT_URL, 'http://www.rollingstone.com/rssxml/music_news.xml');
    as the fifth parameter.

    I can't find mention of "Wrong parameter count for curl_exec" using a Google search.

    Any advice?

    Thanks in advance.

    Steve

  2. #2
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How many arguments does curl_exec() expect?

  3. #3
    SitePoint Member
    Join Date
    Apr 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP site http://au3.php.net/curl doesn't say.

  4. #4
    SitePoint Wizard silver trophy
    Join Date
    Mar 2006
    Posts
    6,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    look at the example in the manual.
    the problem is with curl_exec(), so you would look at the page for that function to learn more about how to use it.

    http://au3.php.net/manual/en/function.curl-exec.php


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •