PHPBench can be installed either as dependency for your project or as a global package.

Install as a PHAR package

Installing as a PHAR is convenient, you will need to download the phar and the public key, this can be done with CURL as follows:

$ curl -o phpbench.phar
$ curl -o phpbench.phar.pubkey

You will probably then want make it executable and put it in your systems global path, on Linux systems:

$ chmod 0755 phpbench.phar
$ sudo mv phpbench.phar /usr/local/bin/phpbench
$ sudo mv phpbench.phar.pubkey /usr/local/bin/phpbench.pubkey

You can update the version at any time by using the self-update command:

$ phpbench self-update


PHPBench is unstable, installing as a PHAR will means that you are always updating to the latest version, the latest version may include BC breaks. Therefore it is recommended to include the package as a project dependency for continuous-integration.

Composer Install

To install PHPBench as a dependency of your project:

$ composer require phpbench/phpbench @dev --dev

You may then run PHPBench from your project’s directory as follows:

$ ./vendor/bin/phpbench

Composer Global Install

You may install PHPBench globally using composer:

$ composer global require phpbench/phpbench @dev


You will need to add Composer’s global bin directory to your systems PATH variable (on linux). See the above link.

You may now run PHPBench simply as:

$ phpbench