Search by

yousha / php-ini-scanner

yousha

A lightweight CLI tool to audit php.ini configurations against development and production standards.

Package info

github.com/Yousha/php-ini-scanner

Homepage

Issues

pkg:composer/yousha/php-ini-scanner

Statistics

Installs: 21

Dependents: 0

Suggesters: 0

Stars: 3

1.1.0.4 2026-11-26 22:30 UTC

This package is auto-updated.

Last update: 2026-11-28 19:33:00 UTC


README

A lightweight CLI tool to audit php.ini configurations against development and production standards.

current version Dependabot Updates PHP PHP issues repo size GitHub license

It compares configured settings against recommended values for either Development or Production environments.

Built using SOLID principles, strict_types=1, and PSR-compliant code.

Requirements

  • Windows or GNU/Linux OS
  • PHP 7.4 or later (PHP 8.x supported).
  • Composer 2 or later.

Screenshots

Screenshot

Installation

Install it in a project:

composer require yousha/php-ini-scanner

Or install it globally:

composer global require yousha/php-ini-scanner

For a global installation, make sure Composer's global vendor bin directory is included in your system PATH.

Usage

Scan for Production

To scan the automatically loaded configuration for the current PHP runtime:

php ./vendor/bin/php-ini-scanner scan -p

Or scan a specific configuration file:

php ./vendor/bin/php-ini-scanner scan -p -i /path/to/php.ini

Scan for Development

To scan the automatically loaded configuration for the current PHP runtime:

php ./vendor/bin/php-ini-scanner scan -d

Scan a specific configuration file:

php ./vendor/bin/php-ini-scanner scan -d -i /path/to/php.ini

For a global Composer installation, run php-ini-scanner instead of php ./vendor/bin/php-ini-scanner.

Commands and options

Option Shortcut Description
--production -p Use the production rule set. Exactly one of -p or -d is required.
--development -d Use the development rule set. Exactly one of -d or -p is required.
--ini-path -i Path to the php.ini file. If omitted, the scanner uses the configuration loaded by the current PHP runtime.
--php-version Target PHP version used to select version-specific rules. Accepts MAJOR.MINOR or MAJOR.MINOR.PATCH;

Exit codes

  • 0: The scan completed and all checked rules passed.
  • 1: The scan encountered a failure or error.

Testing

Run the test suite:

composer test

Run the test suite with code coverage:

composer test-coverage

Coverage reporting requires a supported PHP coverage driver, such as Xdebug or PCOV.

License

This open-source software is distributed under the GPL-3.0-only license. See the LICENSE file.