grantlucas/php-portfinder

A simple tool to find an available port within a range.

Installs: 12 510

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

pkg:composer/grantlucas/php-portfinder

v1.0 2015-01-12 16:29 UTC

This package is auto-updated.

Last update: 2025-09-22 10:07:38 UTC


README

A simple PHP package to find an available port within a range.

Installation using Composer

$ composer require grantlucas/php-portfinder

Usage

The following will return the first available port within the range for the provided host.

require_once(__DIR__ . '/vendor/autoload.php');
use GrantLucas\PortFinder;

$port = PortFinder::range('127.0.0.1', 9901, 9999);