PHPackages                             takuya/php-process-exec - 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. takuya/php-process-exec

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

takuya/php-process-exec
=======================

php process execution with event handling

0.1.5 (1y ago)22.5k—0%1GPL-3.0-or-laterPHPPHP &gt;=8.0CI passing

Since Apr 3Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/takuya/php-process-exec)[ Packagist](https://packagist.org/packages/takuya/php-process-exec)[ RSS](/packages/takuya-php-process-exec/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (6)Used By (1)

Exec Process by php .
---------------------

[](#exec-process-by-php-)

This help to run process by fork ( proc\_open ). This package depends on [proc\_open wrapper class](https://github.com/takuya/php-proc_open-wrapper).

Handling process, *Run Long time command* safety. and Event handler model.

Installing
----------

[](#installing)

by packagist

```
composer require takuya/php-process-exec
```

by GitHub

```
name='php-process-exec'
composer config repositories.$name \
vcs https://github.com/takuya/$name
composer require takuya/$name:master
composer install
```

### Example

[](#example)

Pipe process

```
// prepare
$p1arg = new ExecArgStruct("cat /etc/passwd ");
$p2arg = new ExecArgStruct('grep takuya');
// pipe
$p1 = new ProcessExecutor($p1arg);
$p2 = $p1->pipe($p2arg);
$p2->start();
echo $p2->getOutput();
```

Run CMD STRING by bash.

```
