PHPackages                             emad-mohammed/whm-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. emad-mohammed/whm-api

ActiveLibrary[API Development](/categories/api)

emad-mohammed/whm-api
=====================

WHM &amp; Cpanel API with PHP

v1.0.0(2y ago)08MITPHP

Since Jun 10Pushed 2y ago1 watchersCompare

[ Source](https://github.com/omdda/whm-api)[ Packagist](https://packagist.org/packages/emad-mohammed/whm-api)[ RSS](/packages/emad-mohammed-whm-api/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Whm API
=======

[](#whm-api)

Execute WHM and Cpanel operation with API by PHP

Installation
------------

[](#installation)

Install the latest version with:

```
$ composer require  emad-mohammed/whm-api
```

Requirements
------------

[](#requirements)

- PHP 7.0 or higher is required

Supported Operations for Now
----------------------------

[](#supported-operations-for-now)

- WHM
    - Accounts
        - Get all Cpanel account
        - Create new Cpanel user
        - Delete Cpanel user
        - Get suspensions Cpanel users
        - Suspend Cpanel user
        - Unsuspend Cpanel user
    - Services
        - Restart service
        - Enable service
        - Disable service
        - Get service Status
        - Get service configuration
    - Mail
        - Get email accounts of Cpanel user
- Cpanel
    - there is not supported operation for now

Basic usage
-----------

[](#basic-usage)

```
// All API Calls made throw HTTPS
use \EmadMohammed\WHMAPI\base\WHMClient ;
$ipOrDomain = "YOUR_IP_OR_DOMAIN"; // IP is preferred , we take care of get Domain
$user  = 'root' ; //  for example
$token = "YOUR_TOKEN" ; //
$whmClient = new WHMClient($ipOrDomain , $user , $token);

//--------- Accounts ---------//

// get All Cpanel users
var_dump($whmClient->accountsManagementInstance()->all());

// Create Cpanel users
$diskSizeInMegaBytes = 500; // Default unlimited
var_dump ($whmClient->accountsManagementInstance()->create("USER_NAME" , "PASSWORD" , $diskSizeInMegaBytes));

// get All suspended Cpanel users
var_dump ($whmClient->accountsManagementInstance()->suspensions());

// suspend Cpanel user
var_dump ($whmClient->accountsManagementInstance()->suspendCpanelUser("CPANEL_USER_NAME"));

// suspend Cpanel users
var_dump ($whmClient->accountsManagementInstance()->unsuspendCpanelUser("CPANEL_USER_NAME"));

// delete Cpanel users
var_dump ($whmClient->accountsManagementInstance()->delete("CPANEL_USER_NAME"));

//----------- Services -----------//

/**
*  EmadMohammed\WHMAPI\whm\services\Services class contain some service name , You can use it or pass service's Name
 */

// restart service
var_dump ($whmClient->servicesManagementInstance()->restartService(\EmadMohammed\WHMAPI\whm\services\Services::HTTP));

// Disable Service
var_dump ($whmClient->servicesManagementInstance()->disableService(\EmadMohammed\WHMAPI\whm\services\Services::FTP));

// Enable Service
var_dump ($whmClient->servicesManagementInstance()->enableService(\EmadMohammed\WHMAPI\whm\services\Services::FTP));

// Get Service Config
var_dump ($whmClient->servicesManagementInstance()->getServiceConfig(\EmadMohammed\WHMAPI\whm\services\Services::FTP));

// Get Service Status
var_dump ($whmClient->servicesManagementInstance()->getServiceStatus(\EmadMohammed\WHMAPI\whm\services\Services::FTP));

//------- Mail --------//

// Get email accounts of Cpanel user
var_dump ($whmClient->mailManagementInstance()->getEmailAccountsOfCpanelUser("CPANEL_USER_NAME"));
```

Note
----

[](#note)

If you need any non exists operation , you are welcome to order it .
Contact me on :
 Email :
 whatsapp : [+966500444298](https://wa.me/966500444298)

License
-------

[](#license)

emad-mohammed/whm-api is licensed under the MIT License.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1064d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9ea552dea6127aeb56ae20951d554f2d8ed34e1738bd2cb1495439243a4acb33?d=identicon)[omdda](/maintainers/omdda)

---

Top Contributors

[![omdda](https://avatars.githubusercontent.com/u/32422108?v=4)](https://github.com/omdda "omdda (1 commits)")

### Embed Badge

![Health badge](/badges/emad-mohammed-whm-api/health.svg)

```
[![Health](https://phpackages.com/badges/emad-mohammed-whm-api/health.svg)](https://phpackages.com/packages/emad-mohammed-whm-api)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
