Skip to content
A High Level EPP TCP/SSL Client for PHP
Branch: master
Clone or download
johnny-bit and lifeofguenter Introducing - HTTPClient (#64)
Now this is something interesting, I know many of you fine folks wanted it, so here you have it: HTTPClient supporting connecting to EPP servers over HTTP(S)!
Along with it comes also client abstraction if usual sockets or HTTP is not enough you can now easily write your own!

Also in this commit we have:
 - Further reduce Client complexity
 - Further reduce HTTPClient complexity
Latest commit 0cad113 Jan 7, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
.bash implement php vs phpunit version switcher Apr 1, 2017
src/AfriCC/EPP Introducing - HTTPClient (#64) Jan 7, 2019
tests Add some documentation and tests (#63) Jan 6, 2019
.coveralls.yml oops Apr 20, 2017
.gitattributes prepare for unit-tests Jun 12, 2014
.gitignore fix Apr 20, 2017
.scrutinizer.yml fix tests + minor modernisations... Apr 1, 2017
.styleci.yml allow risky-fixer (#58) Dec 23, 2018
.travis.yml prepare for 1.0.0 (#60) Dec 23, 2018
LICENSE Initial commit Jun 7, 2014 finalise? Apr 27, 2017 run coverage only once in matrix Apr 20, 2017
composer.json Introducing - HTTPClient (#64) Jan 7, 2019
composer.lock Add coveralls support Apr 20, 2017
phpunit.xml.dist add php7.2 + php7.3 travis builds (#59) Dec 23, 2018

Build Status Scrutinizer Code Quality Coverage Status Latest Stable Version Packagist Latest Unstable Version License


php-epp2 is a High Level Extensible Provisioning Protocol (EPP) TCP/SSL client written in modern PHP.

Released under the GPLv3 License, feel free to contribute (fork, create meaningful branchname, issue pull request with thus branchname)!

Table of Contents generated with DocToc


  • PHP 5.5+
  • php-ext-intl
  • php-ext-openssl


  • modern PHP standards
    • PSR-1, PSR-2 & PSR-4
    • notice and warning free (find them, and I'll fix it!)
  • high-level usage (Plug & Play)
  • simplified client (auto login/logout, auto inject clTRID)
  • SSL (+local-cert)
  • XPath like setter to simplify the creation of complex XML structures
  • XML based responses for direct traversal via XPath
  • RFC 5730, RFC 5731, RFC 5732, RFC 5733, RFC 5734 & RFC 3915


Via Composer

$ composer require africc/php-epp2


See the examples folder for a more or less complete usage reference. Additionally have a look at whmcs-registrars-coza which is a WHMCS Registrar Module for the zone using this library.

Basic Client Connection

this will automatically login on connect() and logout on close()

require 'vendor/autoload.php';

use AfriCC\EPP\Client as EPPClient;

$epp_client = new EPPClient([
    'host' => '',
    'username' => 'foo',
    'password' => 'bar',
    'services' => [
    'debug' => true,

try {
    $greeting = $epp_client->connect();
} catch(Exception $e) {
    echo $e->getMessage() . PHP_EOL;


Create Frame Objects

setXXX() indicates that value can only be set once, re-calling the method will overwrite the previous value.

addXXX() indicates that multiple values can exist, re-calling the method will add values.

require 'vendor/autoload.php';

use AfriCC\EPP\Frame\Command\Create\Host as CreateHost;

$frame = new CreateHost;
echo $frame;

// or send frame to previously established connection

Parse Response

You can either access nodes directly by passing through a xpath or use the data() Method which will return an assoc array.

use AfriCC\EPP\Frame\Command\Check\Domain as DomainCheck;
use AfriCC\EPP\Frame\Response;

$frame = new DomainCheck;

$response = $epp_client->request($frame);
if (!($response instanceof Response)) {
    echo 'response error' . PHP_EOL;

$result = $response->results()[0];

echo $result->code() . PHP_EOL;
echo $result->message() . PHP_EOL;
echo $response->clientTransactionId() . PHP_EOL;
echo $response->serverTransactionId() . PHP_EOL;
$data = $response->data();
if (empty($data) || !is_array($data)) {
    echo 'empty response data' . PHP_EOL;

foreach ($data['chkData']['cd'] as $cd) {
    printf('Domain: %s, available: %d' . PHP_EOL, $cd['name'], $cd['@name']['avail']);


  • objectspec on login needs to be smarter (no global/static object, auto-injecter)
  • stricter response parsing
  • stricter request validation
  • make it server capable (in conjunction with apache mod_epp)




php-epp2 is released under the GPLv3 License. See the bundled LICENSE file for details.

You can’t perform that action at this time.