PHPackages                             browserstack/browserstack-local - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. browserstack/browserstack-local

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

browserstack/browserstack-local
===============================

PHP bindings for BrowserStack Local

v1.1.0(9y ago)151.7M↓44.6%10[3 issues](https://github.com/browserstack/browserstack-local-php/issues)[6 PRs](https://github.com/browserstack/browserstack-local-php/pulls)6MITPHPPHP &gt;=5.3.19CI passing

Since May 5Pushed 1y ago15 watchersCompare

[ Source](https://github.com/browserstack/browserstack-local-php)[ Packagist](https://packagist.org/packages/browserstack/browserstack-local)[ Docs](https://github.com/browserstack/browserstack-local-php)[ RSS](/packages/browserstack-browserstack-local/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (4)Dependencies (1)Versions (8)Used By (6)

browserstack-local-php
======================

[](#browserstack-local-php)

[![Build Status](https://camo.githubusercontent.com/b8f2e1ec3c3ddc61bc52bf943ff76b10de74cde76d3d43eed0bc32be64bd10ac/68747470733a2f2f7472617669732d63692e6f72672f62726f77736572737461636b2f62726f77736572737461636b2d6c6f63616c2d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/browserstack/browserstack-local-php)

PHP bindings for BrowserStack Local.

Installation
------------

[](#installation)

Installation is possible using [Composer](https://getcomposer.org/).

If you don't already use Composer, you can download the `composer.phar` binary:

```
curl -sS https://getcomposer.org/installer | php

```

Then install the library:

```
`php composer.phar require browserstack/browserstack-local`

```

Install all depenedencies: `php composer.phar install`

Test the installation by running a simple test file, check out example.php in the main repository.

Example
-------

[](#example)

```
require_once('vendor/autoload.php');
use BrowserStack\Local;

#creates an instance of Local
$bs_local = new Local();

#replace  with your key. You can also set an environment variable - "BROWSERSTACK_ACCESS_KEY".
$bs_local_args = array("key" => "");

#starts the Local instance with the required arguments
$bs_local->start(bs_local_args);

#check if BrowserStack local instance is running
echo $bs_local->isRunning();

#stop the Local instance
$bs_local->stop();

```

Arguments
---------

[](#arguments)

Apart from the key, all other BrowserStack Local modifiers are optional. For the full list of modifiers, refer [BrowserStack Local modifiers](https://www.browserstack.com/local-testing#modifiers). For examples, refer below -

#### Verbose Logging

[](#verbose-logging)

To enable verbose logging -

```
$bs_local_args = array("key" => "", "v" => true);

```

#### Folder Testing

[](#folder-testing)

To test local folder rather internal server, provide path to folder as value of this option -

```
$bs_local_args = array("key" => "", "f" => "/my/awesome/folder");

```

#### Force Start

[](#force-start)

To kill other running Browserstack Local instances -

```
$bs_local_args = array("key" => "", "force" => true);

```

#### Only Automate

[](#only-automate)

To disable local testing for Live and Screenshots, and enable only Automate -

```
$bs_local_args = array("key" => "", "onlyAutomate" => true);

```

#### Force Local

[](#force-local)

To route all traffic via local(your) machine -

```
$bs_local_args = array("key" => "", "forcelocal" => true);

```

#### Proxy

[](#proxy)

To use a proxy for local testing -

- proxyHost: Hostname/IP of proxy, remaining proxy options are ignored if this option is absent
- proxyPort: Port for the proxy, defaults to 3128 when -proxyHost is used
- proxyUser: Username for connecting to proxy (Basic Auth Only)
- proxyPass: Password for USERNAME, will be ignored if USERNAME is empty or not specified

```
$bs_local_args = array("key" => "", "proxyHost" => "127.0.0.1", "proxyPort" => "8000", "proxyUser" => "user", "proxyPass" => "password");

```

#### Local Proxy

[](#local-proxy)

To use local proxy in local testing -

- localProxyHost: Hostname/IP of proxy, remaining proxy options are ignored if this option is absent
- localProxyPort: Port for the proxy, defaults to 8081 when -localProxyHost is used
- localProxyUser: Username for connecting to proxy (Basic Auth Only)
- localProxyPass: Password for USERNAME, will be ignored if USERNAME is empty or not specified

```
$bs_local_args = array("key" => "", "localProxyHost" => "127.0.0.1", "localProxyPort" => "8000", "-localProxyUser" => "user", "-localProxyPass" => "password");

```

#### PAC (Proxy Auto-Configuration)

[](#pac-proxy-auto-configuration)

To use PAC (Proxy Auto-Configuration) in local testing -

- pac-file: PAC (Proxy Auto-Configuration) file’s absolute path

```
$bs_local_args = array("key" => "", "-pac-file" => "");

```

#### Local Identifier

[](#local-identifier)

If doing simultaneous multiple local testing connections, set this uniquely for different processes -

```
$bs_local_args = array("key" => "", "localIdentifier" => "randomstring");

```

Additional Arguments
--------------------

[](#additional-arguments)

#### Binary Path

[](#binary-path)

By default, BrowserStack local wrappers try downloading and executing the latest version of BrowserStack binary in ~/.browserstack or the present working directory or the tmp folder by order. But you can override these by passing the -binarypath argument. Path to specify local Binary path -

```
$bs_local_args = array("key" => "", "binarypath" => "/browserstack/BrowserStackLocal");

```

#### Logfile

[](#logfile)

To save the logs to the file while running with the '-v' argument, you can specify the path of the file. By default the logs are saved in the local.log file in the present woring directory. To specify the path to file where the logs will be saved -

```
$bs_local_args = array("key" => "", "logfile" => "/browserstack/logs.txt");

```

Contribute
----------

[](#contribute)

Testing is possible using [PHPUnit](https://phpunit.de/).

To run the tests, run the command: `phpunit`

### Reporting bugs

[](#reporting-bugs)

You can submit bug reports either in the Github issue tracker.

Before submitting an issue please check if there is already an existing issue. If there is, please add any additional information give it a "+1" in the comments.

When submitting an issue please describe the issue clearly, including how to reproduce the bug, which situations it appears in, what you expect to happen, what actually happens, and what platform (operating system and version) you are using.

### Pull Requests

[](#pull-requests)

We love pull requests! We are very happy to work with you to get your changes merged in, however, please keep the following in mind.

- Adhere to the coding conventions you see in the surrounding code.
- Include tests, and make sure all tests pass.
- Before submitting a pull-request, clean up the git history by going over your commits and squashing together minor changes and fixes into the corresponding commits. You can do this using the interactive rebase command.

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance22

Infrequent updates — may be unmaintained

Popularity50

Moderate usage in the ecosystem

Community31

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 62.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~45 days

Total

4

Last Release

3550d ago

Major Versions

v0.2.0 → v1.0.02016-07-03

### Community

Maintainers

![](https://www.gravatar.com/avatar/5ff4a74bbc6ce76c65dedf81a47bb4616bcaf996eec8e6cc7dd22468a7f1e343?d=identicon)[browserstack](/maintainers/browserstack)

---

Top Contributors

[![tr4n2uil](https://avatars.githubusercontent.com/u/723908?v=4)](https://github.com/tr4n2uil "tr4n2uil (73 commits)")[![nidhimj22](https://avatars.githubusercontent.com/u/6544494?v=4)](https://github.com/nidhimj22 "nidhimj22 (29 commits)")[![vedharish](https://avatars.githubusercontent.com/u/2497481?v=4)](https://github.com/vedharish "vedharish (4 commits)")[![bstack-security-github](https://avatars.githubusercontent.com/u/116066275?v=4)](https://github.com/bstack-security-github "bstack-security-github (3 commits)")[![raghuhit](https://avatars.githubusercontent.com/u/8023137?v=4)](https://github.com/raghuhit "raghuhit (2 commits)")[![bipul21](https://avatars.githubusercontent.com/u/707656?v=4)](https://github.com/bipul21 "bipul21 (1 commits)")[![francisf](https://avatars.githubusercontent.com/u/22143412?v=4)](https://github.com/francisf "francisf (1 commits)")[![thebeardedcoderIN](https://avatars.githubusercontent.com/u/32328894?v=4)](https://github.com/thebeardedcoderIN "thebeardedcoderIN (1 commits)")[![akhillb](https://avatars.githubusercontent.com/u/5848935?v=4)](https://github.com/akhillb "akhillb (1 commits)")[![AdityaHirapara](https://avatars.githubusercontent.com/u/27485533?v=4)](https://github.com/AdityaHirapara "AdityaHirapara (1 commits)")

---

Tags

phpseleniumlocalBrowserStackbrowserstacklocal

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/browserstack-browserstack-local/health.svg)

```
[![Health](https://phpackages.com/badges/browserstack-browserstack-local/health.svg)](https://phpackages.com/packages/browserstack-browserstack-local)
```

###  Alternatives

[element-34/php-webdriver

Thin php client for webdriver

121240.7k1](/packages/element-34-php-webdriver)[imanghafoori/laravel-anypass

A minimal yet powerful package to help you in development.

21422.6k](/packages/imanghafoori-laravel-anypass)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
