PHPackages                             riverside/php-waf - 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. [Security](/categories/security)
4. /
5. riverside/php-waf

ActiveLibrary[Security](/categories/security)

riverside/php-waf
=================

PHP Web Application Firewall

2.0.1(2mo ago)33467↑153.3%13MITPHPPHP &gt;=7.0CI passing

Since Jul 8Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/riverside/php-waf)[ Packagist](https://packagist.org/packages/riverside/php-waf)[ Docs](https://github.com/riverside/php-waf)[ Fund](https://www.paypal.me/Dimitar81)[ RSS](/packages/riverside-php-waf/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (2)Versions (5)Used By (0)

php-waf
=======

[](#php-waf)

PHP Web Application Firewall

BuildStableLicense[![CI](https://github.com/riverside/php-waf/actions/workflows/test.yml/badge.svg)](https://github.com/riverside/php-waf/actions/workflows/test.yml)[![Latest Stable Version](https://camo.githubusercontent.com/d3f919b7f1f04481a2ad815d0729373059d45c22da017fabed49b842fea705cd/68747470733a2f2f706f7365722e707567782e6f72672f7269766572736964652f7068702d7761662f762f737461626c65)](https://packagist.org/packages/riverside/php-waf)[![License](https://camo.githubusercontent.com/dab63e34de18d00f387e0ac7392c4614a5d7c8f966e5b0437c3474db3ba5f68c/68747470733a2f2f706f7365722e707567782e6f72672f7269766572736964652f7068702d7761662f6c6963656e7365)](https://packagist.org/packages/riverside/php-waf)### Requirements

[](#requirements)

- PHP &gt;= 7.0

### Installation

[](#installation)

If Composer is not installed on your system yet, you may go ahead and install it using this command line:

```
$ curl -sS https://getcomposer.org/installer | php

```

Next, add the following require entry to the `composer.json` file in the root of your project.

```
{
    "require" : {
        "riverside/php-waf" : "^2.0.1"
    }
}
```

Finally, use Composer to install php-waf and its dependencies:

```
$ php composer.phar install

```

### How to use

[](#how-to-use)

1. Configure your web server
    - Apache

    ```
    php_value auto_prepend_file "/path/to/waf.php"

    ```

    - Nginx

    ```
    fastcgi_param PHP_VALUE "auto_prepend_file=/path/to/waf.php";

    ```
2. Create an Firewall instance
    - waf.php

    ```
