npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

php-ini-automation

v5.0.8

Published

Ultimate Laravel-optimized PHP configuration tool that automatically detects and configures PHP installations across all environments with Laravel 10+ specific extensions, performance settings, and security configurations

Readme

PHP INI Automation v4.1 🚀

The Ultimate Laravel-Optimized PHP Configuration Tool - Intelligent, Powerful, Laravel-Ready

npm version License: MIT Downloads Platform Laravel

Revolutionary cross-platform PHP detection and configuration tool specifically optimized for Laravel development. Automatically finds and configures ALL your PHP installations with Laravel-specific extensions, performance settings, and security configurations across ANY environment and ANY operating system!

🎯 Quick Start: npm install -g php-ini-automation && pia 🚀 Laravel Ready: Optimized for Laravel 10+ with all required extensions and performance settings

🌟 Revolutionary Features

🔍 Intelligent Detection System

  • 🎯 Multi-Method Detection: System PATH, Windows Registry, Deep Scanning, Environment Variables
  • 🏗️ Universal Environment Support: Laragon, XAMPP, WAMP, PVM, MAMP, Uniform Server, Bitnami, Custom
  • 🔄 Multi-Version Detection: Automatically finds ALL PHP versions in each environment
  • 📊 Comprehensive Analysis: Architecture, Thread Safety, Build Date, Configuration details

Professional CLI Experience

  • 🎨 Beautiful Interface: Colored output, formatted tables, progress indicators
  • 🤖 Interactive Selection: Choose from detected installations with smart defaults
  • 📋 Detailed Reporting: Real-time feedback on extensions and settings
  • 🛡️ Validation System: Pre-flight checks and troubleshooting suggestions

🚀 Advanced Configuration

  • 📦 Smart Extension Management: Validates extension files before enabling
  • ⚙️ Laravel-Optimized Settings: Performance, security, and development settings
  • 💾 Automatic Backup: Timestamped backups before any changes
  • 🔧 Custom Settings Support: Add your own PHP configurations

🎯 Laravel-Specific Optimizations

📦 Essential Extensions (Auto-Enabled)

  • Core Requirements: curl, mbstring, openssl, tokenizer, xml, ctype, json, fileinfo
  • Database Support: pdo_mysql, pdo_sqlite, pdo_pgsql, mysqli, sqlite3
  • Laravel Features: bcmath, gd, zip, intl, soap, xsl, ldap, exif
  • Performance: opcache, apcu

⚙️ Performance Settings

  • Memory: 1GB limit for Composer and migrations
  • Execution Time: 300 seconds for Artisan commands
  • File Uploads: 256MB support for large files
  • OPcache: Optimized for Laravel with 512MB cache
  • Realpath Cache: 8MB cache for faster file resolution

🔒 Security Configurations

  • Session Security: HTTPOnly, SameSite, Strict Mode
  • PHP Exposure: Hidden version information
  • Error Handling: Development-friendly error reporting
  • File Access: Secure file upload and include settings

🎯 Laravel-Ready Features

  • Timezone: UTC default for consistent timestamps
  • Encoding: UTF-8 for international support
  • Artisan Support: CLI optimizations for Artisan commands
  • Composer Ready: Memory and time limits for package management

🌍 Cross-Platform Support

🪟 Windows Environments

| Environment | Multi-Version | Auto-Detection | Deep Scan | Priority | |-------------|---------------|----------------|-----------|----------| | System PATH | ✅ | ✅ | ✅ | 🥇 Highest | | Laragon | ✅ | ✅ | ✅ | 🥈 High | | PVM | ✅ | ✅ | ✅ | 🥉 High | | WAMP/WAMP64 | ✅ | ✅ | ✅ | 🏅 Medium | | XAMPP | ✅ | ✅ | ✅ | 🏅 Medium | | MAMP | ✅ | ✅ | ✅ | 🏅 Medium | | Uniform Server | ✅ | ✅ | ✅ | 🏅 Medium | | Bitnami | ✅ | ✅ | ✅ | 🏅 Medium |

🐧 Linux Environments

| Environment | Multi-Version | Auto-Detection | Deep Scan | Priority | |-------------|---------------|----------------|-----------|----------| | System PATH | ✅ | ✅ | ✅ | 🥇 Highest | | Ubuntu/Debian APT | ✅ | ✅ | ✅ | 🥈 High | | CentOS/RHEL YUM/DNF | ✅ | ✅ | ✅ | 🥉 High | | Homebrew | ✅ | ✅ | ✅ | 🏅 Medium | | Custom/Compiled | ✅ | ✅ | ✅ | 🏅 Low |

🍎 macOS Environments

| Environment | Multi-Version | Auto-Detection | Deep Scan | Priority | |-------------|---------------|----------------|-----------|----------| | System PATH | ✅ | ✅ | ✅ | 🥇 Highest | | Homebrew | ✅ | ✅ | ✅ | 🥈 High | | MAMP | ✅ | ✅ | ✅ | 🥉 High | | Custom/Compiled | ✅ | ✅ | ✅ | 🏅 Low |

🔍 Detection Methods

  1. System PATH Scanning - Finds active PHP installations
  2. Windows Registry - Discovers registered PHP installations
  3. Environment Variables - Respects manual configurations
  4. Deep Directory Scanning - Recursively searches common paths
  5. Intelligent Pattern Matching - Recognizes PHP directory structures

Installation

Global Installation (Recommended)

npm install -g php-ini-automation

🎉 After installation, you can use the short alias pia instead of php-ini-automation!

Local Installation

npm install php-ini-automation

🎯 Quick Reference

Essential Shortcuts

| Command | Description | Example | |---------|-------------|---------| | pia | Configure PHP (auto-detect) | pia | | pia -l | List all PHP installations | pia -l | | pia -v | Show version information | pia -v | | pia -h | Show help | pia -h | | pia 8.2 | Configure specific PHP version | pia 8.2 |

🔥 One-Liner Examples

# Quick setup for Laravel development
pia

# Check what PHP versions are available
pia -l

# Configure PHP 8.2 specifically
pia 8.2

# Get help and see all options
pia -h

# Check tool version
pia -v

Usage

🚀 Quick Start Commands

⚡ Super Quick (Recommended)

# Configure PHP (auto-detect)
pia

# List all PHP installations
pia -l

# Show version information
pia -v

# Show help
pia -h

# Configure specific PHP version
pia 8.2

📋 All Available Commands

# Main commands
php-ini-automation              # Auto-detect and configure PHP
pia                             # Short alias (same as above)

# Version-specific
php-ini-automation 8.2          # Configure PHP 8.2
pia 8.2                         # Short form

# Information commands
php-ini-automation --list       # List all detected installations
pia -l                          # Short form

php-ini-automation --version    # Show version information
pia -v                          # Short form

php-ini-automation --help       # Show help
pia -h                          # Short form

# Advanced options
php-ini-automation --non-interactive  # Run without prompts
pia --non-interactive           # Short form

Command Line Interface

# Use default PHP version
php-ini-automation
pia                             # Short alias

# Specify PHP version
php-ini-automation 8.2
pia 8.2                         # Short form

# With environment variables
LARAGON_PATH="C:/laragon" php-ini-automation 8.1
LARAGON_PATH="C:/laragon" pia 8.1  # Short form

Programmatic Usage

import { updatePhpIni, customizePhpIni } from 'php-ini-automation';

// Update PHP ini for default version
await updatePhpIni();

// Update PHP ini for specific version
await updatePhpIni('8.2');

// Custom settings
await customizePhpIni('/path/to/php.ini', '/path/to/ext', {
    memory_limit: '1G',
    max_execution_time: 300
});

Environment Variables

Set these environment variables to help the tool locate your PHP installation:

# For Laragon
LARAGON_PATH=C:/laragon

# For XAMPP
XAMPP_PATH=C:/xampp

# For WAMP
WAMP_PATH=C:/wamp64

# For PVM (PHP Version Manager)
PVM_PATH=C:/tools/php

# Custom PHP installation
DEFAULT_PATH=C:/php

Extensions Enabled

The tool automatically enables these PHP extensions required by Laravel:

  • curl
  • pdo_sqlite
  • sqlite3
  • openssl
  • pdo_mysql
  • mbstring
  • tokenizer
  • json
  • fileinfo
  • ctype
  • xml
  • bcmath
  • gd
  • zip

Default Settings Applied

max_execution_time = 120
memory_limit = 512M
output_buffering = Off
zlib_output_compression = Off

Development

Prerequisites

  • Node.js 16+
  • TypeScript 5+

Setup

git clone https://github.com/yourusername/php-ini-automation.git
cd php-ini-automation
npm install

Build

npm run build

Development Mode

npm run dev

API Reference

updatePhpIni(version?: string): Promise<void>

Updates the php.ini configuration for the specified PHP version.

Parameters:

  • version (optional): PHP version to update for (e.g., '8.2', '8.1')

customizePhpIni(filePath: string, extensionsDir: string, customSettings?: Record<string, string | number>): Promise<void>

Customizes a specific php.ini file with extensions and settings.

Parameters:

  • filePath: Path to the php.ini file
  • extensionsDir: Directory containing PHP extensions
  • customSettings (optional): Additional PHP settings to apply

determinePhpIniPaths(version?: string): { iniPath: string, extensionDir: string }

Determines the appropriate paths for php.ini and extensions directory.

Parameters:

  • version (optional): PHP version

Returns:

  • Object with iniPath and extensionDir properties

validateSourceFile(filePath: string): void

Validates that a php.ini file exists at the specified path.

Parameters:

  • filePath: Path to validate

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support