Varnish admin socket for executing varnishadm CLI commands using PHP
Switch branches/tags
Clone or download
Latest commit 8aaa8ba Apr 13, 2018

VarnishAdmin PHP Library

VarnishAdmin is a PHP Library for manage Varnish reverse proxy cache commands using PHP


VarnishAdmin is supported on PHP 5.6.* and up.


To install this package, run the command below and you will get the latest version

composer require jeslopcru/varnishadmin

or include this in your composer.json

  "require": {
    "jeslopcru/varnishadmin": "dev-master"


It's very easy to use VarnishAdmin. If you have any question please open an issue

Varnish 5

  $varnish = new VarnishAdminSocket('', 6082, '5.0.0');

Varnish 4

  $varnish = new VarnishAdminSocket('', 6082, '4.0.3');

Varnish 3

  //purge postId  (id = 354)
  $varnish = new VarnishAdminSocket();

Pull Request

Pull request are welcome using PSR-2, all issues are welcomed


The whole VarnishAdmin package, is released under the MIT license, see LICENSE.

You can use this repo for Docker:

Based on timwhitlock/php-varnish