grantlucas / php-portfinder
A simple tool to find an available port within a range.
Installs: 12 066
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
This package is auto-updated.
Last update: 2024-10-22 08:14:31 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);