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.

Why any use of cURL and socket PHP functions fails in my WHM plugin ?

Discussion in 'cPanel Developers' started by stephane02, Dec 15, 2011.

  1. stephane02

    stephane02 Member

    Joined:
    Dec 14, 2011
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello,

    I'm working on a WHM plugins I placed at /usr/local/cpanel/whostmgr/docroot/cgi and prefixed with addon_ like this: addon_myphpplugin.php

    Into my script I need to interact with a remote service through their REST API. I've tried cURL without success then I used easyapache interface to recompile apache with cURL enabled and still no way. I've been trying stream_context_create() with file_get_contents() no success, still no success with socket_create() too. I started thinking my plugin could be working in sandbox environment where all these functions are disabled. I have some success running curl with system() function and it's not a good practice I know...So can you help me understand if WHM developpers have integrated a way to handle HTTP POST/GET/PUT/DELETE requests...

    My WHM environment:
    WHM 11.30.5W
    CENTOS 5.7 x86_64 vmware on cs009


    Thank you

    Stephane
     
  2. stephane02

    stephane02 Member

    Joined:
    Dec 14, 2011
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page