PHPackages                             rosell-dk/locate-binaries - 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. rosell-dk/locate-binaries

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

rosell-dk/locate-binaries
=========================

Locate a binaries by means of exec() or similar

1.0(4y ago)27.0M—5.5%[1 issues](https://github.com/rosell-dk/locate-binaries/issues)2MITPHPPHP &gt;=5.6

Since Apr 20Pushed 2y ago1 watchersCompare

[ Source](https://github.com/rosell-dk/locate-binaries)[ Packagist](https://packagist.org/packages/rosell-dk/locate-binaries)[ GitHub Sponsors](https://github.com/rosell-dk)[ Fund](https://ko-fi.com/rosell)[ RSS](/packages/rosell-dk-locate-binaries/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (6)Versions (2)Used By (2)

Locate Binaries
===============

[](#locate-binaries)

[![Build Status](https://github.com/rosell-dk/locate-binaries/workflows/build/badge.svg)](https://github.com/rosell-dk/locate-binaries/actions/workflows/php.yml)[![Coverage](https://camo.githubusercontent.com/26e151e4574b77b36ef328432d89652ff7852317f10d273bf778202f40dc11ba/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f75726c3d68747470733a2f2f6c6974746c652d622e69742f6c6f636174652d62696e61726965732f636f64652d636f7665726167652f636f7665726167652d62616467652e6a736f6e)](http://little-b.it/locate-binaries/code-coverage/coverage/index.html)[![Software License](https://camo.githubusercontent.com/c034ea3669e2235bbe1c2c8756eecebcc6384b71bfec57ad155c5e3f33cd1387/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d3431383637372e737667)](https://github.com/rosell-dk/locate-binary/blob/master/LICENSE)[![Latest Stable Version](https://camo.githubusercontent.com/9de873a767cc95fce71dd19df9e37b99c4af3e7c25dc9c83b4014edad9ec9b8c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f726f73656c6c2d646b2f6c6f636174652d62696e61726965732e737667)](https://packagist.org/packages/rosell-dk/locate-binaries)[![Minimum PHP Version](https://camo.githubusercontent.com/f3fb2a8c786682f3e3029db3b78e8682c3c7e70d2c2876153179d89319c50701/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f726f73656c6c2d646b2f6c6f636174652d62696e6172696573)](https://php.net)

Just a little class for locating binaries. You need `exec()`, `shell_exec()` or similar enabled for it to work. Otherwise, it will throw.

Works on Linux, Windows and Mac.

Usage
-----

[](#usage)

To locate installed `cwebp` binaries (found on Linux with `which -a`, falling back to `whereis -b`; on Windows found using `where`):

```
use LocateBinaries\LocateBinaries;

$cwebBinariesFound = LocateBinaries::locateInstalledBinaries('cwebp');

```

Note that you get an array of matches - there may be several versions of a binary on a system.

The library also adds another method for locating binaries by peeking in common system paths, such as *usr/bin* and `C:\Windows\System32`However, beware that these dirs could be subject to open\_basedir restrictions which can lead to warning entries in the error log. The other method is therefore best.

Well warned, here it is the alternative, which you in some cases might want to fall back to after trying the first.

```
$imagickBinariesFound = LocateBinaries::locateInCommonSystemPaths('convert');

```

Installing
----------

[](#installing)

Install with composer:

```
composer require rosell-dk/locate-binaries

```

Notes
-----

[](#notes)

The library uses the [exec-with-fallback](https://github.com/rosell-dk/exec-with-fallback) library in order to be able to use alternatives to exec() when exec() is disabled.

Do you like what I do?
----------------------

[](#do-you-like-what-i-do)

Perhaps you want to support my work, so I can continue doing it :)

- [Become a backer or sponsor on Patreon](https://www.patreon.com/rosell).
- [Buy me a Coffee](https://ko-fi.com/rosell)

Thanks!

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity47

Moderate usage in the ecosystem

Community11

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

1490d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/17592708?v=4)[Bjørn Rosell](/maintainers/rosell-dk)[@rosell-dk](https://github.com/rosell-dk)

---

Top Contributors

[![rosell-dk](https://avatars.githubusercontent.com/u/17592708?v=4)](https://github.com/rosell-dk "rosell-dk (39 commits)")

---

Tags

discoverbinarywhichlocatewhereis

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/rosell-dk-locate-binaries/health.svg)

```
[![Health](https://phpackages.com/badges/rosell-dk-locate-binaries/health.svg)](https://phpackages.com/packages/rosell-dk-locate-binaries)
```

###  Alternatives

[spatie/php-structure-discoverer

Automatically discover structures within your PHP application

17824.5M57](/packages/spatie-php-structure-discoverer)[alchemy/binary-driver

A set of tools to build binary drivers

19110.9M39](/packages/alchemy-binary-driver)[comcast/php-legal-licenses

A utility to generate a Licenses file containing the full license text for every dependency in your project for legal purposes.

821.1M9](/packages/comcast-php-legal-licenses)[wapmorgan/binary-stream

A handy tool for working with binary data

52263.1k6](/packages/wapmorgan-binary-stream)[ademarre/binary-to-text-php

Collection of binary-to-text encoding utilities for PHP. Includes Base32 support and much more.

40165.8k](/packages/ademarre-binary-to-text-php)[phar-io/composer-distributor

Base Code for a composer plugin that installs PHAR-files

13581.1k6](/packages/phar-io-composer-distributor)

PHPackages © 2026

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