Skip to main content

How to get or set php_directives using WHM API 1

Comments

9 comments

  • cPanelMichael
    Hello, The following WHM API 1 function requires root access to the server: WHM API 1 Functions - php_ini_get_directives - Software Development Kit - cPanel Documentation Thus, you'd need to authenticate as the "root" user to run this command. Thank you.
    0
  • manish12345
    I am using WHM account username and password while executing API but still get the permission issue, Look at the code below which i executes

    Is that anything wrong i do in API call, Please guide me any better way if exist, I am using PHP as backend language.
    0
  • cPanelMichael
    $whm_user = 'WHMUSER';

    Can you confirm if this is the "root" username, or a reseller username? Thank you.
    0
  • manish12345
    Yes this is reseller user, see the attached image of control panel after successful login.
    0
  • cPanelMichael
    Hello, The WHM API 1 function you are using only works with "root" access and not resellers:
    0
  • manish12345
    I understand it but why its not allowed to change php directives using reseller account, a reseller account has privileges for creating and manipulating account but not allowed to configure simple settings via API call, thats not fair. I can easily configure it manually by going to cpanel dashboard, my requirement is to change it from API call and untill it is not solved my site functionality in not complete. Please allow it also for reseller accounts.
    0
  • cPanelMichael
    Hello, It's not possible to update PHP versions and settings through Web Host Manager as a reseller. However, you are correct that this is possible for individual cPanel accounts. Here is the corresponding UAPI module available for use with individual cPanel accounts: UAPI Modules - LangPHP - Software Development Kit - cPanel Documentation I encourage you to open a feature request if you'd like to see an option to modify PHP version and configuration settings as a reseller:
    0
  • manish12345
    Thanks for reply, i have submit a feature request. and i tried the UAPI Module and its not working, give the following error {"status":0,"data":null,"messages":null,"errors":["(XID ypckg2) "PHP" is not installed on the system.">,"metadata":{}}
    0
  • cPanelMichael
    and i tried the UAPI Module and its not working, give the following error {"status":0,"data":null,"messages":null,"errors":["(XID ypckg2) "PHP" is not installed on the system.">,"metadata":{}}

    Could you let us know how we can reproduce the error message? Have you tried reproducing the issue using the UAPI function via the command line? Thank you.
    0

Please sign in to leave a comment.