Download the PHP package rcalicdan/process-killer without Composer

On this page you can find all versions of the php package rcalicdan/process-killer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package process-killer

PHP Process Killer

Fast, non-blocking, and cross-platform process tree termination for PHP.

Standard PHP tools like proc_terminate() or posix_kill() are often insufficient for complex process management. On Windows, native termination can block the executing thread; on Unix-like systems, terminating a parent process frequently leaves orphan grandchildren running in the background.

rcalicdan/process-killer resolves these issues by implementing platform-specific, asynchronous, and recursive termination strategies to safely and immediately tear down target processes and all of their descendants.

Latest Release


Features


Installation

Ensure your environment meets the minimum requirement of PHP 8.3+.


Usage

The library exposes a single, static entry point designed to cleanly accept one or more process IDs (PIDs).

Basic Example

Why Async Termination Matters (The Windows Problem)

When executing @proc_terminate($resource) in PHP on Windows, the call often blocks the active PHP thread while waiting for the OS kernel to acknowledge the operation. Under high throughput or inside an async event loop, this stalls execution.

ProcessKiller solves this by spawning a detached, shell-bypassed background process on Windows:

This commands exits in microseconds, handing the actual termination work over to the Windows OS in the background while your event loop continues to execute.


Under the Hood: Strategies

ProcessKiller detects the host operating system family at runtime and dynamically chooses the most efficient strategy:

1. Windows (taskkill)

Issues a taskkill /F /T command to forcefully (/F) terminate the entire process tree (/T) of the given PID. This is executed as a fire-and-forget command bypassing the command shell.

2. Linux /proc Mapping

Rather than calling shell utilities iteratively, the library reads directly from the Linux /proc directory. It parses /proc/$pid/stat in a robust single-pass scan (safely handling process names with spaces or parentheses) to build a relational parent-child process map, then delivers a SIGKILL to the targets.

3. macOS / BSD ps Mapping

Constructs parent-child process maps in a single, high-performance execution of ps -eo pid,ppid,pgid, grouping processes and terminating them via negative-PID signals (SIGKILL to process groups) where applicable.

4. Fallback (Iterative pgrep)

If the system lacks direct access to /proc or standard ps configurations, the library falls back to progressive discovery using pgrep -P to discover child PIDs recursively.


Development & Testing

Clone the repository and run the test and analysis suites:


License

This library is open-source software licensed under the MIT License.


All versions of process-killer with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package rcalicdan/process-killer contains the following files

Loading the files please wait ...