
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)
- PowerShell
-
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
# 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
# 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
| Component | Description |
|---|---|
| Directories | PHP versions are stored as C:\xampp\php{version}\. The active one is always C:\xampp\php\. |
| Apache Config | httpd-xampp.conf is updated to load the correct php7apache2_4.dll or php8apache2_4.dll. |
| Module Name | PHP 7.x uses php7_module, PHP 8.x uses php_module (XAMPP convention). |
| Backup | A backup of httpd-xampp.conf.bak is created on first switch. |
| Services | Apache is automatically stopped before switching and restarted after configuration updates. |
๐ฏ Installation
Option 1: MSI Installer (Recommended)
Download the latest MSI installer from GitHub Releases and run it. The installer will automatically add pxp to your PATH.
Option 2: Manual Installation
- Clone the repository:
git clone https://github.com/pphatdev/pxp-cli.git
-
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
-
Open a new terminal and run:
pxp help
๐ Documentation
- ๐ README - Getting started and basic usage
- ๐ง Troubleshooting Guide - Common issues and solutions
- ๐ค Contributing Guide - How to contribute
- ๐จโ๐ป Development Guide - Technical documentation
- ๐ Security Policy - Security best practices
- ๐ Changelog - Version history
๐ง 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:
- ๐ Report bugs - Open an issue
- ๐ก Suggest features - Request a feature
- ๐ Submit pull requests - Read the contributing guide
- ๐ Improve documentation - Help make docs better
- โญ Star the repository - Show your support
๐ License
MIT ยฉ pphatdev
Made with ๐ง to resolve PHP version switching issues
Version: 1.3.1
Last Updated: March 2026
GitHub: pphatdev/pxp-cli
