Skip to main content

Login into cPanel with curl in php

Comments

10 comments

  • cPanelMichael
    Hello, The following document should help, and includes PHP examples: Guide to API Authentication - Software Development Kit - cPanel Documentation Thanks!
    0
  • amitwebethics411
    Hi Thanks for the fast reply use lib '/usr/local/cpanel'; How I can get this? Can you give me this liberary? I am being able to get logged in to my cpanel account. but not possible to third person account who come on my site to take backup Thanks
    0
  • amitwebethics411
    132.148.xx.xxx:2083/cpsess3979807116/login/?session=pickupherew%3ahGFZD6Y3FxEejN25%3acreate_user_session%2c874804442c9944d3129301bf484a57bce I get a sessionurl some thing like this when I open this url in the browser it get me logged in straight away. but when I am hitting this with curl it doing nothing giving error like this [16-Dec-2016 07:38:10 Etc/GMT] curl_exec111 threw error "Failed to connect to 132.148.xx.xxx port 2083: Connection timed out" for 132.148.xx.xxx:2083/cpsess3979807116/login/?session=pickupherew%3ahGFZD6Y3FxEejN25%3acreate_user_session%2c87480444d2c9944d3129301bf484a57bce
    0
  • cPanelMichael
    Hello, Could you provide some more information about the exact steps you are taking, and what your custom script looks like? For instance, which example are you following from the URL in my last response? Please provide as much information as possible to help us reproduce the issue. Thank you.
    0
  • amitwebethics411
    I am trying every possible solution to get the result. But all in vain. I am trying a third party login into the cpanel. I just need a script to login in to the third party server and takes backup. Like I am on server 208.91.xxx.xx and I want to login and take a backup of the 132.148.xx.xxx . Is that possible to do ? the you can give me definite solution please Login in to the Cpanel is not my concern. The main concern is to get backup of any email account with cpanel details. I am using cpanel xmlapi 1 to get the backup. I am able to get backup of my server on which my code is hosted but not able to get the backup of any other backup. can you available to chat India Time 9.30 to 6.30. So that I can get to a conclusion weather it is possible or not to take any backup Thanks
    0
  • cPanelMichael
    Hello, What you are seeking is discussed on the following thread: Backing up accounts (hacky way) Let us know if that thread helps. Thank you.
    0
  • amitwebethics411
    I am looking for a php solution the first solution that is described in the thread that what I using already
    0
  • cPanelMichael
    I am able to get backup of my server on which my code is hosted but not able to get the backup of any other backup.

    Do you have cPanel login credentials to the remote server, and if so, do backup options work manually via the cPanel UI on that server? This is required if you want to setup a script to run a cPanel API 1 backup functions on a remote server. Thank you.
    0
  • amitwebethics411
    hi Every time I created a new crontab in the cron jobs a new linkey (unique ID ) is added to the current cron queue. How I can stop that ? It is also updated every time I updated a cron job earlier set by me Thanks return $xmlapi->api2_query($account, "Cron", "edit_line", array( "linekey" => $line_key, "command"=>$command, "day"=>$day, "hour"=>$hour, "minute"=>$minute, "month"=>$month, "weekday"=>$weekday )); return $xmlapi->api2_query($account, "Cron", "add_line", array( "command"=>$command, "day"=>$day, "hour"=>$hour, "minute"=>$minute, "month"=>$month, "weekday"=>$weekday ));die;
    0
  • cPanelMichael
    Every time I created a new crontab in the cron jobs a new linkey (unique ID ) is added to the current cron queue. How I can stop that ? It is also updated every time I updated a cron job earlier set by me

    Could you let us know the step-by-step instructions we can take to reproduce this issue? Please include details about the specific cron job and commands you are using. Thank you.
    0

Please sign in to leave a comment.