PHPackages                             zwiazeksyndykalistowpolski/phpdenyhosts - 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. zwiazeksyndykalistowpolski/phpdenyhosts

AbandonedArchivedProject[Security](/categories/security)

zwiazeksyndykalistowpolski/phpdenyhosts
=======================================

Analyzes unwanted traffic and blocks spam using htaccess

372[5 PRs](https://github.com/zwiazeksyndykalistowpolski/php-denyhosts/pulls)PHP

Since May 12Pushed 7y ago1 watchersCompare

[ Source](https://github.com/zwiazeksyndykalistowpolski/php-denyhosts)[ Packagist](https://packagist.org/packages/zwiazeksyndykalistowpolski/phpdenyhosts)[ RSS](/packages/zwiazeksyndykalistowpolski-phpdenyhosts/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (6)Used By (0)

PhpDenyhosts
============

[](#phpdenyhosts)

[![Build Status](https://camo.githubusercontent.com/5bb7e9bbe76046abd1c5057520abad970cd364f988732ae411673a4563955b76/68747470733a2f2f7472617669732d63692e6f72672f7a7769617a656b73796e64796b616c6973746f77706f6c736b692f7068702d64656e79686f7374732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/zwiazeksyndykalistowpolski/php-denyhosts)

Inspired by the *denyhosts* and *fail2ban* projects created **to secure cheap shared hostings** where is no access to the shell, but there is still an **access.log** and **Apache htaccess** accessible from PHP side.

#### History of creation

[](#history-of-creation)

Creation of simple Wordpress blog to allow adding information about pickets, strikes and other direct actions by a regional/brand section of workers union is an easier way to create an elegant card, a personalized portfolio.

The problem is that Wordpress is very often attacked by various bots, they are brute forcing different parts like the administration panel, the login page, xmlrpc just to gain the access and infect and send their shitty spam.

This project was created to ban unwanted traffic, so the server could be more responsive and more secure.

Created originally by [Wolnościowiec team](https://github.com/Wolnosciowiec) for [Związek Syndykalistów Polski](http://zsp.net.pl) (Polish section of [International Workers Association](http://iwa-ait.org/) ).

Installation
------------

[](#installation)

```
# via git
git clone https://github.com/zwiazeksyndykalistowpolski/php-denyhosts.git
composer install

# via composer
composer require create-project zwiazeksyndykalistowpolski/phpdenyhosts phpdenyhosts

```

Configuration
-------------

[](#configuration)

In `configuration` directory there is a possibility to place multiple configuration files for every domain/project, please use the `config.default.php.example` as an example.

See more:

- [More documentation about the configuration](./configuration/README.md)
- [Technical information about variables meaning, and a template of configuration](./configuration/config.default.php.example)

Good practices
--------------

[](#good-practices)

To secure installation of PhpDenyhosts you may want to generate a strong token in every of your environment. Proposed length is 64 characters.

Other thing - you can place this application in a directory with random prefix or suffix. Example: `denyhosts_9zbnKILG7e9HnVhW`. So the bots would have it more difficult to find out that you are using this project.

Testing from shell
------------------

[](#testing-from-shell)

To simulate logs parsing you can add an environment variable "PDH\_SIMULATE" that would tell to not save anything, just print the logs.

Example:

```
PDH_SIMULATE=true env=default php index.php

```

TODO
----

[](#todo)

- unit tests

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/9bcf126fe030a49d883299ee4d99f7b9c67ffa348baf329117df9bb850ceccdc?d=identicon)[blackandred](/maintainers/blackandred)

---

Top Contributors

[![blackandred](https://avatars.githubusercontent.com/u/22807686?v=4)](https://github.com/blackandred "blackandred (17 commits)")

---

Tags

access-logsanarchistapacheblockerbots-protectioncheapddos-protectiondenyhostsdos-protectionfail2banhtaccessmicroservicenginxphp7phpdenyhostsshared-hostingtraffic-analysiswolnosciowiecwordpress

### Embed Badge

![Health badge](/badges/zwiazeksyndykalistowpolski-phpdenyhosts/health.svg)

```
[![Health](https://phpackages.com/badges/zwiazeksyndykalistowpolski-phpdenyhosts/health.svg)](https://phpackages.com/packages/zwiazeksyndykalistowpolski-phpdenyhosts)
```

###  Alternatives

[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k18.7M139](/packages/mews-purifier)[paragonie/ecc

PHP Elliptic Curve Cryptography library

24820.0k36](/packages/paragonie-ecc)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
