The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

cPanel Plugin cURL Error

Discussion in 'General Discussion' started by xrserver, Apr 10, 2008.

  1. xrserver

    xrserver Well-Known Member

    Joined:
    Jan 18, 2008
    Messages:
    47
    Likes Received:
    0
    Trophy Points:
    6
    Hey, I am new to this but I am writing a little plugin for my server but I keep getting this error when executing it. I know some people are going to say I need to get curl but I do have it and I have checked to make sure. I even ran other scripts that use curl so I have no idea why I am getting this. Does anybody know?

    Fatal error: Call to undefined function curl_init() in /usr/local/cpanel/whostmgr/docroot/cgi/test/test.php on line 17
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    You have cURL, but did you compile cURL support into PHP? I ask only because you didn't explicitly state how you checked that you had cURL.
     
  3. xrserver

    xrserver Well-Known Member

    Joined:
    Jan 18, 2008
    Messages:
    47
    Likes Received:
    0
    Trophy Points:
    6
    Yes curl is compiled with php. In fact below you will find part of the output of a phpinfo file.

    I cant figure out what is causing this, I have other php scripts and even this script works fine when in my home directory but when I put it in the /usr/local/cpanel/whostmgr/docroot/cgi/test/ folder i get this when trying to execute it.

    './configure' '--disable-pdo' '--enable-bcmath' '--enable-calendar' '--enable-exif' '--enable-ftp' '--enable-gd-native-ttf' '--enable-libxml' '--enable-magic-quotes' '--enable-mbstring' '--enable-sockets' '--prefix=/usr' '--with-curl=/opt/curlssl/' '--with-freetype-dir=/usr' '--with-gd' '--with-gettext' '--with-imap=/opt/php_with_imap_client/' '--with-imap-ssl=/usr' '--with-jpeg-dir=/usr' '--with-kerberos' '--with-libexpat-dir=/usr' '--with-libxml-dir=/opt/xml2/' '--with-mcrypt=/opt/libmcrypt/' '--with-mhash=/opt/mhash/' '--with-mysql=/usr' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-openssl=/usr' '--with-openssl-dir=/usr' '--with-png-dir=/usr' '--with-ttf' '--with-xmlrpc' '--with-xpm-dir=/usr' '--with-zlib' '--with-zlib-dir=/usr'
     
  4. stoo2000

    stoo2000 Active Member

    Joined:
    Jul 26, 2003
    Messages:
    43
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Leicestershire, UK
    cPanel Access Level:
    Root Administrator
    IIRC cPanel/WHM has its own build of PHP for CP use, that might not have Curl enabled.
     
  5. xrserver

    xrserver Well-Known Member

    Joined:
    Jan 18, 2008
    Messages:
    47
    Likes Received:
    0
    Trophy Points:
    6
    Ok just decided to use sockets for now and it works fine. I have another question though. This is a script I only want my master resellers to be able to access. So how would I check if they have master reseller access. I wanted to make it to where I have a folder with files each named after a user that I want to have access to this. How would I make my cgi script detect which user is logged in and the look for that file in the /access directory.
     
    #5 xrserver, Apr 10, 2008
    Last edited: Apr 10, 2008
  6. xrserver

    xrserver Well-Known Member

    Joined:
    Jan 18, 2008
    Messages:
    47
    Likes Received:
    0
    Trophy Points:
    6
    Also does anyone know how I could make a form submit the data to my plugin in the background without actually going to the plugin. Right now when i hit submit it sends the data but it goes to the actually plugin and i need it to just submit the data but stay on the form page.

    And also it be nice if someone could tell my how to make a loading bar appear while it is submitting the data.
     
  7. nickp666

    nickp666 Well-Known Member

    Joined:
    Jan 28, 2005
    Messages:
    770
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    /dev/null
    you'd need to use ajax to submit it in the background
     
  8. xrserver

    xrserver Well-Known Member

    Joined:
    Jan 18, 2008
    Messages:
    47
    Likes Received:
    0
    Trophy Points:
    6
    Ok thanks, now my only problem right now seems to be what I put 3 posts up.
     
Loading...

Share This Page