PHPackages                             mickaelmonsieur/pve2-api-php-client - 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. mickaelmonsieur/pve2-api-php-client

ActiveLibrary[API Development](/categories/api)

mickaelmonsieur/pve2-api-php-client
===================================

Client API for Proxmox PVE

0249PHP

Since Nov 5Pushed 7y ago1 watchersCompare

[ Source](https://github.com/mickaelmonsieur/pve2-api-php-client)[ Packagist](https://packagist.org/packages/mickaelmonsieur/pve2-api-php-client)[ RSS](/packages/mickaelmonsieur-pve2-api-php-client/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

This class provides the building blocks for someone wanting to use PHP to talk to Proxmox 2.0. Relatively simple piece of code, just provides a get/put/post/delete abstraction layer as methods on top of Proxmox's REST API, while also handling the Login Ticket headers required for authentication.

See [http://pve.proxmox.com/wiki/Proxmox\_VE\_API](http://pve.proxmox.com/wiki/Proxmox_VE_API) for information about how this API works. API spec available at

Requirements:
-------------

[](#requirements)

PHP 5 with cURL (including SSL) support.

Usage:
------

[](#usage)

Example - Return status array for each Proxmox Host in this cluster.

```
require("./pve2-api-php-client/pve2_api.class.php");

# You can try/catch exception handle the constructor here if you want.
$pve2 = new PVE2_API("hostname", "username", "realm", "password");
# realm above can be pve, pam or any other realm available.

/* Optional - enable debugging. It print()'s any results currently */
// $pve2->set_debug(true);

if ($pve2->login()) {
    foreach ($pve2->get_node_list() as $node_name) {
        print_r($pve2->get("/nodes/".$node_name."/status"));
    }
} else {
    print("Login to Proxmox Host failed.\n");
    exit;
}

```

Example - Create a new OpenVZ Container on the first host in the cluster.

```
require("./pve2-api-php-client/pve2_api.class.php");

# You can try/catch exception handle the constructor here if you want.
$pve2 = new PVE2_API("hostname", "username", "realm", "password");
# realm above can be pve, pam or any other realm available.

/* Optional - enable debugging. It print()'s any results currently */
// $pve2->set_debug(true);

if ($pve2->login()) {

    # Get first node name.
    $nodes = $pve2->get_node_list();
    $first_node = $nodes[0];
    unset($nodes);

    # Create a VZ container on the first node in the cluster.
    $new_container_settings = array();
    $new_container_settings['ostemplate'] = "local:vztmpl/debian-6.0-standard_6.0-4_amd64.tar.gz";
    $new_container_settings['vmid'] = "1234";
    $new_container_settings['cpus'] = "2";
    $new_container_settings['description'] = "Test VM using Proxmox 2.0 API";
    $new_container_settings['disk'] = "8";
    $new_container_settings['hostname'] = "testapi.domain.tld";
    $new_container_settings['memory'] = "1024";
    $new_container_settings['nameserver'] = "4.2.2.1";

    // print_r($new_container_settings);
    print("---------------------------\n");

    print_r($pve2->post("/nodes/".$first_node."/openvz", $new_container_settings));
    print("\n\n");
} else {
    print("Login to Proxmox Host failed.\n");
    exit;
}

```

Example - Modify DNS settings on an existing container on the first host.

```
require("./pve2-api-php-client/pve2_api.class.php");

# You can try/catch exception handle the constructor here if you want.
$pve2 = new PVE2_API("hostname", "username", "realm", "password");
# realm above can be pve, pam or any other realm available.

/* Optional - enable debugging. It print()'s any results currently */
// $pve2->set_debug(true);

if ($pve2->login()) {

    # Get first node name.
    $nodes = $pve2->get_node_list();
    $first_node = $nodes[0];
    unset($nodes);

    # Update container settings.
    $container_settings = array();
    $container_settings['nameserver'] = "4.2.2.2";

    # NOTE - replace XXXX with container ID.
    var_dump($pve2->put("/nodes/".$first_node."/openvz/XXXX/config", $container_settings));
} else {
    print("Login to Proxmox Host failed.\n");
    exit;
}

```

Example - Delete an existing container.

```
require("./pve2-api-php-client/pve2_api.class.php");

# You can try/catch exception handle the constructor here if you want.
$pve2 = new PVE2_API("hostname", "username", "realm", "password");
# realm above can be pve, pam or any other realm available.

/* Optional - enable debugging. It print()'s any results currently */
// $pve2->set_debug(true);

if ($pve2->login()) {
    # NOTE - replace XXXX with node short name, and YYYY with container ID.
    var_dump($pve2->delete("/nodes/XXXX/openvz/YYYY"));
} else {
    print("Login to Proxmox Host failed.\n");
    exit;
}

```

Licensed under the MIT License. See LICENSE file.

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 70.4% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4144662?v=4)[Mickael](/maintainers/mickaelmonsieur)[@mickaelmonsieur](https://github.com/mickaelmonsieur)

---

Top Contributors

[![CpuID](https://avatars.githubusercontent.com/u/916201?v=4)](https://github.com/CpuID "CpuID (19 commits)")[![ThomasLamprecht](https://avatars.githubusercontent.com/u/526413?v=4)](https://github.com/ThomasLamprecht "ThomasLamprecht (4 commits)")[![danhunsaker](https://avatars.githubusercontent.com/u/1534396?v=4)](https://github.com/danhunsaker "danhunsaker (2 commits)")[![mickaelmonsieur](https://avatars.githubusercontent.com/u/4144662?v=4)](https://github.com/mickaelmonsieur "mickaelmonsieur (1 commits)")[![ypilpre](https://avatars.githubusercontent.com/u/5433576?v=4)](https://github.com/ypilpre "ypilpre (1 commits)")

### Embed Badge

![Health badge](/badges/mickaelmonsieur-pve2-api-php-client/health.svg)

```
[![Health](https://phpackages.com/badges/mickaelmonsieur-pve2-api-php-client/health.svg)](https://phpackages.com/packages/mickaelmonsieur-pve2-api-php-client)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

94452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

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