PHPackages                             lawrencekm/server-info - 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. lawrencekm/server-info

ActiveLibrary

lawrencekm/server-info
======================

A package to retrieve server information

11PHP

Since Feb 9Pushed 2y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

### Server Info Package

[](#server-info-package)

---

A PHP package for retrieving Server information and System services details for monitoring purposes.

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

[](#installation)

To install the package in your PHP project:

```
    composer require lawrencekm/server-info

```

You can also Clone the repository or download the source code.

```
    git clone https://github.com/lawrencekm/server-info.git

```

Install dependencies using Composer.

```
    composer install

```

Usage
-----

[](#usage)

To use the Server Info package, follow these steps:

Initialize the ServerInfo class in your PHP code.

```
    require __DIR__ . '/vendor/autoload.php';

    $serverInfo = new ServerInfo();
    Retrieve server information in JSON format.

    echo $serverInfo->getServerInformation();
    //Optionally, you can render the information as an HTML table.

    // echo $serverInfo->getServerInformation(); // Uncomment this line if not already called
    $data = json_decode($serverInfo->getServerInformation(), true);

    // Render HTML tables

```

Testing
-------

[](#testing)

To run tests using PHPUnit, follow these steps:

Ensure PHPUnit is installed as a development dependency. `    composer install --dev`Run PHPUnit tests. `./vendor/bin/phpunit tests`

Running as Web Server
---------------------

[](#running-as-web-server)

You can run the application as a web server using Docker. Choose one of the following methods:

Method 1: Dockerfile
--------------------

[](#method-1-dockerfile)

Create a Dockerfile with the following content:

```
```
FROM php:8.2-apache
COPY . /var/www/html/
```

```

Build and run the Docker container: `docker build -t my-server-info . docker run -p 8080:80 -d my-server-info`

Method 2: Without Dockerfile
----------------------------

[](#method-2-without-dockerfile)

Run the following Docker command to get the output on browser localhost:8080:

`  docker run -d -p 8080:80 --name my-server-info-php-app -v "$PWD":/var/www/html php:8.2-apache`

Run Via Command Line
--------------------

[](#run-via-command-line)

You can also run index.php file via the command line to get a json response:

`php index.php`

###  Health Score

13

—

LowBetter than 1% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity19

Early-stage or recently created project

 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/109df3428aa11314a50758d7528aa19d73dc4499becd809bd9c48ee4537908e3?d=identicon)[lawrencekm04](/maintainers/lawrencekm04)

---

Top Contributors

[![lawrencekm](https://avatars.githubusercontent.com/u/16874670?v=4)](https://github.com/lawrencekm "lawrencekm (14 commits)")

### Embed Badge

![Health badge](/badges/lawrencekm-server-info/health.svg)

```
[![Health](https://phpackages.com/badges/lawrencekm-server-info/health.svg)](https://phpackages.com/packages/lawrencekm-server-info)
```

PHPackages © 2026

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