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.

php fails

Discussion in 'General Discussion' started by sniperscope, May 22, 2012.

  1. sniperscope

    sniperscope Well-Known Member

    Joined:
    Apr 5, 2011
    Messages:
    118
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    osaka/ japan
    cPanel Access Level:
    Website Owner
    Hello
    My account creation php script was working well but it is not working since i upgrade whm version.

    Whenever i run it i am getting
    Warning: file_get_contents() [function.file-get-contents]: Couldn't resolve host name in /home/test/public_html/test/cart/create.php on line 87

    Has any idea?
     
  2. NixTree

    NixTree Well-Known Member

    Joined:
    Aug 19, 2010
    Messages:
    387
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Gods Own Country
    cPanel Access Level:
    Root Administrator
    Hello,

    The error is explicit from the message.

    What domain / hostname is specified in line 87 of /home/test/public_html/test/cart/create.php file? It cannot resolve the particular FQDN; perhaps you can give any other mean to access your destination which is resolvable!

    Thank you,
    Nibin.
     
  3. sniperscope

    sniperscope Well-Known Member

    Joined:
    Apr 5, 2011
    Messages:
    118
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    osaka/ japan
    cPanel Access Level:
    Website Owner
    I have used my own script before and i have used following code since my original script failed.

    <?php

    // your WHM username
    $whm_user = 'root';

    // your WHM password
    $whm_pass = 'password';

    // your WHM hostname
    $whm_host = '123.123.123.123';

    // new account domain or subdomain name
    $user_domain = 'newdomain.com';

    // new account username (8 characters or less)
    $user_name = 'newuser';

    // new account password
    $user_pass = 'password'

    // new account contact email
    $user_email = 'user@domain.com';

    // new account plan (must be an existing WHM plan)
    $user_plan = 'basic';

    // create the account
    $site = "http://{$whm_user}:{$whm_pass}@{$whm_host}:2086/scripts/wwwacct";
    $params = "?plan={$user_plan}";
    $params .= "&domain={$user_domain}";
    $params .= "&username={$user_name}";
    $params .= "&password={$user_pass}";
    $params .= "&contactemail={$user_email}";
    $result = file_get_contents($site.$params);
    echo $result;

    ?>
     
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    So what was line 87 in that /home/test/public_html/test/cart/create.php script then? is it calling whm_host or something else?

    Also, what does your /etc/resolv.conf file look like?
     
Loading...

Share This Page