PHPackages                             titanium-iridium/vmwarephp - 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. titanium-iridium/vmwarephp

ActiveLibrary[API Development](/categories/api)

titanium-iridium/vmwarephp
==========================

VMWare vSphere API bindings for PHP

014PHP

Since Mar 2Pushed 9y ago1 watchersCompare

[ Source](https://github.com/titanium-iridium/vmwarephp)[ Packagist](https://packagist.org/packages/titanium-iridium/vmwarephp)[ RSS](/packages/titanium-iridium-vmwarephp/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Vmwarephp
---------

[](#vmwarephp)

Vmwarephp is a library containing bindings for vSphere API using PHP. You can use it to manage ESX and vCenter servers. It was inspired by other efforts of constructing vSphere bindings for other dynamically typed languages like RbvMomi for Ruby. Currently the library supports vSphere API from version 4.1 to 5.1.1.

Prerequisites
-------------

[](#prerequisites)

Vmwarephp requires PHP version 5.3.2 or greater with soap and ssl enabled. For more information on how to compile PHP from source and enable extensions please check: .

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

[](#installation)

Vmwarephp can be installed using Composer or by cloning it from its GitHub repository.

**Using Composer**

You can read more about Composer and its main repository at [http://packagist.org](http://packagist.org "Packagist"). To install Vmwarephp using Composer, first install Composer following the instructions on the Packagist home page. After that, you can define a dependency on Vmwarephp by adding the following lines to your composer.json:

```
{
    "require": {
        "titanium-iridium/vmwarephp": "dev-master"
    }
}

```

**Using Git / GitHub**

You can clone the latest development branch from its github repository:

```
git clone git://github.com/titanium-iridium/vmwarephp.git

```

Usage
-----

[](#usage)

Vmwarephp aims to provide the least boilerplate code possibile for handling vSphere objects. The ESX/vCenter on which the operations are performed is represented by a \\Vmwarephp\\Vhost object. A Vhost object provides two finder methods to obtain server side ManagedObjects. The following example describes a way to collect all virtual machines from a ESX/vCenter with their config status prefetched:

```
$vhost = new \Vmwarephp\Vhost(['host' => 'vcenter:443', 'username' => 'root', 'password' => 'the_secret']);
$virtualMachines = $vhost->findAllManagedObjects('VirtualMachine', array('configStatus'));

```

For collecting all virtual machines with all their properties pre-fetched, which normally is a very expensive operation considering that a lot of objects need to be traversed you can do it in the following way:

```
$virtualMachines = $vhost->findAllManagedObjects('VirtualMachine', 'all');

```

You can find a given object using its server side id. For example finding a datastore with id datastore-182 with none of its properties prefetched:

```
$vhost = new \Vmwarephp\Vhost(['host' => 'vcenter:443', 'username' => 'root', 'password' => 'the_secret']);
$datastore = $vhost->findOneManagedObject('Datastore', 'datastore-182', array());

```

A managed object can also be found by name:

```
$vhost = new \Vmwarephp\Vhost(['host' => 'vcenter:443', 'username' => 'root', 'password' => 'the_secret']);
$datastore = $vhost->findManagedObjectByName('VirtualMachine', 'myvmname', array('configStatus'));

```

Managed objects can be a generic managed object represented by \\Vmwarephp\\ManagedObject or a user defined extension of a managed object defined in Extensions directory. Each managed object depending on its managed object reference type ('VirtualMachine', 'Datastore', etc.) can execute any of methods defined by the vSphere api on that reference type. For example taking a virtual machine snapshot can be as easy as:

```
$vhost = new \Vmwarephp\Vhost(['host' => 'vcenter:443', 'username' => 'root', 'password' => 'the_secret']);
$virtualMachine = $vhost->findOneManagedObject('VirtualMachine', 'vm-192', array());
$snapshotTask = $virtualMachine->CreateSnapshot_Task(array('name' => 'snapshot_name', 'memory' => false, 'quiesce' => false));

```

or considering that the VirtualMachine managed object type has a built in extension already:

```
$snapshotTask = $virtualMachine->takeSnapshot(array('name' => 'snapshot_name', 'memory' => false, 'quiesce' => false));

```

All managed object properties are defined as object accessors. You can pre-fetch all accessors when looking for the object or you can query an object property on the fly (note that we are not pre-fetching the configStatus property):

```
$virtualMachine = $vhost->findOneManagedObject('VirtualMachine', 'vm-192', array());
$configStatus = $virtualMachine->configStatus;

```

Or prefetching the configStatus:

```
$virtualMachine = $vhost->findOneManagedObject('VirtualMachine', 'vm-192', array('configStatus'));

```

As you can see working with managed objects is extremely easy. Each method supported by a managed object on the server side is mapped to a method on \\Vmwarephp\\ManagedObject or an extension. Properties are exposed as simple accessor methods. All data object properties are also mapped to their respective types. A full list of defined types can be found in TypeDefinitions.inc file.

You can write your own extensions by extending the \\Vmwarephp\\ManagedObject and adding it to Extensions directory. If you consider the extensions is really useful we can easily integrate it in the main branch. Enjoy!

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.3% 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://www.gravatar.com/avatar/a8d149939403609e136e388aabf052237572459add39a9fd744dd698595a52ad?d=identicon)[titanium-iridium](/maintainers/titanium-iridium)

---

Top Contributors

[![vadimcomanescu](https://avatars.githubusercontent.com/u/507870?v=4)](https://github.com/vadimcomanescu "vadimcomanescu (66 commits)")[![estheban](https://avatars.githubusercontent.com/u/638460?v=4)](https://github.com/estheban "estheban (3 commits)")[![titanium-iridium](https://avatars.githubusercontent.com/u/6576123?v=4)](https://github.com/titanium-iridium "titanium-iridium (1 commits)")

### Embed Badge

![Health badge](/badges/titanium-iridium-vmwarephp/health.svg)

```
[![Health](https://phpackages.com/badges/titanium-iridium-vmwarephp/health.svg)](https://phpackages.com/packages/titanium-iridium-vmwarephp)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M475](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M270](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M452](/packages/google-gax)

PHPackages © 2026

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