Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Directory not creating/also subdomains

Discussion in 'General Discussion' started by gillz, May 31, 2008.

  1. gillz

    gillz Member

    Joined:
    May 31, 2008
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    51
    have vps server with whm cpanel and for my sites also cpanel i have issue i cant make folder/dir with php code
    mkdir('mydir', 0777); like this and also cant make subdoamins with coding i have script there people can make therir own wap sites and i use this coding
    $name=$_POST['name'];
    mkdir (strtolower("$name"));
    @ chmod(strtolower("$name",0755));
    mkdir(strtolower("$name/files"));
    @ chmod(strtolower("$name/files",0755));
    mkdir(strtolower("$name/pics"));
    @ chmod(strtolower("$name/pics",0755));

    and for make their subdoamin i use



    $cpanel_user = "username";
    $cpanel_password = "password";
    $cpanel_host = "mysite.com";


    file("http://.$cpanel_user.":".$cpanel_password."@".$cpanel_host:2082/frontend/x2/subdomain/doadddomain.html?domain=$name&rootdomain=mysite.com'");

    and it was worked at my normal site but now at vps it wont work users data dum in data base but there no folder /dir make like if user name is test it should be http://test.mysite.com

    but nor subdoamin and others folder creat in user dir/folder

    is it shell_exec issue if yes then how can i solve it ?

    hope you understand my issue and help me thanks
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. viraj

    viraj Well-Known Member

    Joined:
    Sep 28, 2006
    Messages:
    209
    Likes Received:
    1
    Trophy Points:
    166
    Location:
    India
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Hi,

    You need to make sure that you have proper permissions for the web scripts to create directories on the server. If shell_exec() is disabled, you can try using curl_exec(). It's an alternative for the disabled function but less harmful :)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. cPanelNick

    cPanelNick Administrator
    Staff Member

    Joined:
    Mar 9, 2015
    Messages:
    3,483
    Likes Received:
    31
    Trophy Points:
    158
    cPanel Access Level:
    DataCenter Provider
    You really should use the xml api for this

    http://www.cpanel.net/plugins/xmlapi/cpanel.html


    file("http://.$cpanel_user.":".$cpanel_password."@".$cpanel_hos t:2082/xml-api/cpanel?cpanel_xmlapi_module=SubDomain&cpanel_xmlapi_func=addsubdomain&cpanel_xmlapi_apiversion=1&domain=$name&rootdomain=mysite.com'");
     
  4. gillz

    gillz Member

    Joined:
    May 31, 2008
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    51
    here i get error
    SubDomainaddsubdomaineventinternal1Error from domain wrapper: .mysire.com could not be modified because it does not resolve to a valid IP address. Please ask the system admin to check their resolv.conf and their dns trust relationship Ignore any messages of success this can only result in failure!

    i just changed after
    2082:xml-api/cpanel?cpanel_xmlapi_module=SubDomain&cpanel_xmlapi_func=addsubdomain&cpanel_xmlapi_apiversion=1&domain=$name&rootdomain=mysite.com'");


    is there wrong somthing?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. gillz

    gillz Member

    Joined:
    May 31, 2008
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    51
    i have solved issue abt mk dir with php.ini
    also very very thanks of Dave Lanning
    Technical Analyst 1 and Ken Folse who provide me good support as i never thought and you all guys now only subdomain issue is still

    very nice support
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #5 gillz, Jun 1, 2008
    Last edited: Jun 2, 2008
  6. gillz

    gillz Member

    Joined:
    May 31, 2008
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    51
    hello, there are no any plugin for make subdomain can you help me please?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice