Installing

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

Composer Install

To install PHPBench as a dependency of your project:

$ composer require phpbench/phpbench --dev

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

$ ./vendor/bin/phpbench

Install as a PHAR package

You can download the phar and the public key, this can be done with CURL as follows:

$ curl -o phpbench.phar https://phpbench.github.io/phpbench/phpbench.phar
$ curl -o phpbench.phar.pubkey https://phpbench.github.io/phpbench/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

Warning

Installing as a PHAR 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.