PHPackages                             mikehaertl/php-shellcommand - 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. [CLI &amp; Console](/categories/cli)
4. /
5. mikehaertl/php-shellcommand

ActiveLibrary[CLI &amp; Console](/categories/cli)

mikehaertl/php-shellcommand
===========================

An object oriented interface to shell commands

1.7.0(3y ago)32437.5M↑10.8%54[3 issues](https://github.com/mikehaertl/php-shellcommand/issues)[2 PRs](https://github.com/mikehaertl/php-shellcommand/pulls)20MITPHPPHP &gt;= 5.3.0CI failing

Since Jul 7Pushed 5mo ago10 watchersCompare

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

READMEChangelog (10)Dependencies (1)Versions (28)Used By (20)Security (1)

php-shellcommand
================

[](#php-shellcommand)

[![GitHub Tests](https://github.com/mikehaertl/php-shellcommand/workflows/Tests/badge.svg)](https://github.com/mikehaertl/php-shellcommand/actions)[![Packagist Version](https://camo.githubusercontent.com/3062069c16c283289a4fb19b4b0595fa3741ebd44df22c369fd1b42d8b8de660/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d696b6568616572746c2f7068702d7368656c6c636f6d6d616e643f6c6162656c3d76657273696f6e)](https://packagist.org/packages/mikehaertl/php-shellcommand)[![Packagist Downloads](https://camo.githubusercontent.com/ec0acc9cdb07ec5fff5ddb3313d6992f1aebb417aaa904e3b129fee590e3e072/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d696b6568616572746c2f7068702d7368656c6c636f6d6d616e64)](https://packagist.org/packages/mikehaertl/php-shellcommand)[![GitHub license](https://camo.githubusercontent.com/ad8c05483897599d53411d5c8e516c627bec917e92a390805e4a4234de4b05eb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d696b6568616572746c2f7068702d7368656c6c636f6d6d616e64)](https://github.com/mikehaertl/php-shellcommand/blob/master/LICENSE)[![Packagist PHP Version Support](https://camo.githubusercontent.com/72adf8287d732000b0305c6a17c6b81b5b81bae7701085aeb4cab1573bce261b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6d696b6568616572746c2f7068702d7368656c6c636f6d6d616e64)](https://packagist.org/packages/mikehaertl/php-shellcommand)

php-shellcommand provides a simple object oriented interface to execute shell commands.

Installing
----------

[](#installing)

### Prerequisites

[](#prerequisites)

Your php version must be `5.4` or later.

### Installing with composer

[](#installing-with-composer)

This package can be installed easily using composer.

```
composer require mikehaertl/php-shellcommand

```

Features
--------

[](#features)

- Catches `stdOut`, `stdErr` and `exitCode`
- Handle argument escaping
- Pass environment vars and other options to `proc_open()`
- Pipe resources like files or streams into the command
- Timeout for execution

Examples
--------

[](#examples)

### Basic Example

[](#basic-example)

```
