51Degrees Pipeline PHP  4.1Newer Version 4.4

51Degrees Pipeline for PHP

51Degrees PHP Device Detection

51Degrees PHP Device Detection

Developer Documentation


This project contains the source code for the PHP implementation of 51Degrees' cloud-based device detection engine for use with the Pipeline API.


To run the examples, you will need PHP and composer installed. Once these are available, install the dependencies required by the examples. Navigate to the repository root and execute:

composer install

This will create the vendor directory containing autoload.php. Now navigate to the examples directory and start a PHP server with the relevant file. For example:

PHP -S localhost:3000 cloud/gettingstarted.php

This will start a local web server listening on port 3000. Open your web browser and browse to http://localhost:3000/ to see the example in action.


This repo has tests for the examples. To run the tests, make sure PHPUnit is installed then, in the root of this repo, call:

phpunit --log-junit test-results.xml

On-premise device detection

The on-premise implementation of device detection is much faster but requires more memory and processing power than the cloud version. Unfortunately, distributing the on-premise package via composer would require the inclusion of binary executables (.so/.dll) that are not permitted. If you wish to use the on-premise version then you will need to clone the on-premise repository and follow the instructions in the readme to build the required modules. This is a fairly involved process so feel free to contact us if you are having difficulties.