Logo
pxp - PHP Version Switcher for XAMPP
Back
PowerShell Batchfile .NET
@CLI @PHP @XAMPP @Developer Tools
5 days ago

pxp - PHP Version Switcher for XAMPP

A simple yet powerful CLI tool to manage multiple PHP versions in XAMPP on Windows. Switch between PHP versions instantly with automatic Apache configuration.


โœจ About Project

PXP (Personal XAMPP PHP) is a simple yet powerful CLI tool to manage multiple PHP versions in XAMPP on Windows. Built for developers who need to test their applications across different PHP versions, PXP makes version switching effortless. With just a single command, you can switch between PHP 7.x and 8.x versions, download new versions automatically, and manage your PHP installations safely. The tool handles all the complexity of Apache configuration updates, module naming conventions, and service management, ensuring smooth transitions between versions.

๐Ÿ› ๏ธ Project Tech Stack

  • Core:

    • PowerShell 5.1+
    • Windows Batch Files
    • .NET SDK 6.0+ (for MSI installer)
  • Dependencies:

    • XAMPP (Windows)
    • Windows 10/11
    • Apache 2.4
  • Distribution:

    • MSI Installer (WiX Toolset)
    • GitHub Releases
    • Manual Installation

๐ŸŒˆ Project Features

  • ๐Ÿ”„ Instant Version Switching - Switch between PHP versions with a single command
  • ๐Ÿ“ฆ Automatic Downloads - Install new PHP versions directly from windows.php.net
  • ๐Ÿ—‘๏ธ Safe Uninstall - Remove PHP versions with confirmation and validation
  • ๐Ÿ“‹ Version Listing - View all installed PHP versions with active version indicator
  • ๐ŸŒ Global PHP Discovery - Fetch available stable PHP versions from PHP.net
  • โšก Auto Apache Config - Automatic Apache configuration and module updates
  • ๐Ÿ›ก๏ธ Safe Backups - Automatic backups before switching versions
  • ๐Ÿš€ Service Management - Automatic Apache stop/start during version switching
  • ๐Ÿ“ฆ MSI Installer - Easy installation with automatic PATH configuration
  • ๐Ÿ”ง Git Bash Support - Compatible with Windows terminals and Git Bash

๐Ÿ’ป Key Commands

Here are the main commands available in PXP:

Version Management

bash
# Show PXP version
pxp -v

# List installed PHP versions
pxp list

# Show current active PHP version
pxp current

# Switch to a different PHP version
pxp switch 8.3.15

# List all available PHP versions globally
pxp list -php -global

Installation & Uninstallation

bash
# Download and install a new PHP version
pxp install 8.3.6

# Uninstall a PHP version
pxp uninstall 8.0.30

# Get help
pxp help

How It Works

ComponentDescription
DirectoriesPHP versions are stored as C:\xampp\php{version}\. The active one is always C:\xampp\php\.
Apache Confighttpd-xampp.conf is updated to load the correct php7apache2_4.dll or php8apache2_4.dll.
Module NamePHP 7.x uses php7_module, PHP 8.x uses php_module (XAMPP convention).
BackupA backup of httpd-xampp.conf.bak is created on first switch.
ServicesApache is automatically stopped before switching and restarted after configuration updates.

๐ŸŽฏ Installation

Download the latest MSI installer from GitHub Releases and run it. The installer will automatically add pxp to your PATH.

Option 2: Manual Installation

  1. Clone the repository:
bash
git clone https://github.com/pphatdev/pxp-cli.git
  1. Add the folder to your system PATH:

    • Settings โ†’ System โ†’ About โ†’ Advanced system settings
    • Environment Variables โ†’ Path โ†’ New
    • Add the full path to where you cloned/extracted the files
  2. Open a new terminal and run:

bash
pxp help

๐Ÿ“š Documentation

๐Ÿ”ง Requirements

  • Windows 10/11 - Required for PowerShell support
  • XAMPP - Installed at C:\xampp (default location)
  • PowerShell 5.1+ - Pre-installed on Windows 10/11
  • .NET SDK 6.0+ - Only needed for building the MSI installer

๐Ÿค Contributing

Contributions are welcome! Here's how you can help:

๐Ÿ“„ License

MIT ยฉ pphatdev

Made with ๐Ÿ˜ง to resolve PHP version switching issues


Version: 1.3.1
Last Updated: March 2026
GitHub: pphatdev/pxp-cli