PHPackages                             shieldpress/tracker-php - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. shieldpress/tracker-php

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

shieldpress/tracker-php
=======================

Website tracking, monitoring &amp; security SDK for PHP — Laravel, Symfony, Slim, and vanilla PHP. Reports metrics to ShieldPress.

1.1.5(1mo ago)012↓66.7%MITPHPPHP &gt;=7.4

Since Jul 18Pushed 1mo agoCompare

[ Source](https://github.com/vithanhlam/ShieldPress-Tracker-PHP)[ Packagist](https://packagist.org/packages/shieldpress/tracker-php)[ RSS](/packages/shieldpress-tracker-php/feed)WikiDiscussions main Synced 2w ago

READMEChangelogDependencies (2)Versions (8)Used By (0)

 [ ![ShieldPress](https://camo.githubusercontent.com/628f808e0745da9fac86e6d55e04661c061d9e12ddb51a807285f6978525fcfb/68747470733a2f2f736869656c6470726573732e6e65742f6c6f676f2e706e67) ](https://shieldpress.net/)

 **Real-time website monitoring, security &amp; performance tracking for PHP applications.**
 [Visit ShieldPress Dashboard →](https://shieldpress.net/)

shieldpress/tracker-php
=======================

[](#shieldpresstracker-php)

A lightweight, zero-dependency SDK that monitors your PHP application in real time. It collects system metrics, HTTP performance data, security threats, and runtime health — then reports everything to your [ShieldPress](https://shieldpress.net) dashboard for visualization and alerting.

> **Get started free** — sign up at [shieldpress.net](https://shieldpress.net/) to create your dashboard, then install this SDK to start monitoring.

Features
--------

[](#features)

- **System Metrics** — CPU, RAM, disk, load average, OPcache hit rate
- **HTTP Tracking** — response times (avg, p50, p95, p99), status codes, top paths, RPS
- **Error Tracking** — exceptions, PHP errors, manual captures with stack traces
- **Security Monitoring** — SQL injection, XSS, command injection, path traversal, bot detection, brute-force
- **Runtime Performance** — OPcache stats, memory peak, included files, realpath cache
- **Environment Security** — PHP version EOL check, security headers, `display_errors`, `expose_php`, sensitive env vars
- **Database Monitoring** — query count, slow queries, per-connection stats, top slowest queries
- **Cache Monitoring** — hit/miss rates, Redis server info, memory usage, evicted keys
- **External HTTP Tracking** — outgoing API calls, per-host stats, slow call detection
- **Laravel Integration** — ServiceProvider, Middleware, config publishing
- **Generic Middleware** — works with any PHP app (Slim, Symfony, vanilla PHP)
- **Zero dependencies** — only requires `ext-json` and `ext-curl`

Requirements
------------

[](#requirements)

- PHP &gt;= 7.4
- ext-json
- ext-curl

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

[](#installation)

```
composer require shieldpress/tracker-php
```

Quick Start
-----------

[](#quick-start)

### Laravel

[](#laravel)

**1. Add env vars:**

```
SHIELDPRESS_API_KEY=sp_xxx
SHIELDPRESS_SITE_ID=site_xxx
```

**2. Publish config (optional):**

```
php artisan vendor:publish --tag=shieldpress-config
```

**3. Add middleware to `bootstrap/app.php` (Laravel 11+):**

```
->withMiddleware(function (Middleware $middleware) {
    $middleware->append(\ShieldPress\Tracker\Middleware\LaravelMiddleware::class);
})
```

**Or for Laravel 10 in `app/Http/Kernel.php`:**

```
protected $middleware = [
    \ShieldPress\Tracker\Middleware\LaravelMiddleware::class,
    // ...
];
```

That's it! The ServiceProvider auto-registers via composer.json `extra.laravel.providers`.

### Vanilla PHP

[](#vanilla-php)

```
