| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
[pxp] Personal Xampp PHP version switcher for CLI. A simple yet powerful CLI tool to manage multiple PHP versions in XAMPP on Windows.
Download the latest MSI installer from Releases and run it. The installer will automatically add pxp to your PATH.
git clone https://github.com/pphatdev/php-version-switcher.gitSettings → System → About → Advanced system settings → Environment Variables → Path → New
Add the full path to where you cloned/extracted the files.
pxp helpNote: Pxp is designed for Windows Command Prompt or PowerShell. If using Git Bash or other bash terminals, see the Git Bash compatibility guide.
pxp -v
# or
pxp --versionDisplays the current Pxp version.
pxp list
# or explicitly list local versions
pxp list -php -localOutput example:
Installed PHP versions: * 7.4.33 (active, php7) 8.0.30 (8.0.30) 8.2.27 (8.2.27)
pxp list -php -globalThis fetches the latest stable PHP versions available from windows.php.net (Thread-Safe x64 builds).
Output example:
Fetching available PHP versions from windows.php.net...
Available stable PHP versions (Thread-Safe x64):
PHP 8.3:
8.3.15
8.3.14
8.3.13
PHP 8.2:
8.2.27
8.2.26
PHP 8.1:
8.1.31
8.1.30
To install a version: pxp install <version>
pxp currentDisplays the currently active PHP version in XAMPP.
pxp switch 8.0.30
# or use the alias
pxp use 8.0.30This will:
pxp install 8.3.6Downloads the thread-safe x64 build from windows.php.net and extracts it to C:\xampp\php8.3.6\.
After installing, switch to it:
pxp switch 8.3.6pxp uninstall 8.0.30Removes an installed PHP version from your system. This will:
Note: You cannot uninstall the currently active PHP version. Switch to a different version first.
pxp helpShows all available commands with examples.
| 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. |
If you want to build the installer from source:
Install the .NET SDK 6.0+
Build the MSI:
dotnet build ./installer/Pxp.wixproj -c ReleaseThe MSI will be created in installer\bin\Release\
To specify a custom version:
dotnet build ./installer/Pxp.wixproj -c Release -p:ProductVersion=1.0.0📖 For detailed troubleshooting solutions, see TROUBLESHOOTING.md
If you see "cannot be loaded. The file is not digitally signed" error:
Run your terminal as Administrator if you encounter permission errors when switching PHP versions.
Apache virtual host warnings (e.g., Could not resolve host name) are unrelated to PHP switching — they come from your virtual host configuration in httpd-vhosts.conf.
Contributions are welcome! We appreciate any help in improving pxp-cli.
Before contributing, please read:
# Clone the repository
git clone https://github.com/pphatdev/pxp-cli.git
cd pxp-cli
# Test the script
.\pxp.ps1 help
# Build the installer
dotnet build ./installer/Pxp.wixproj -c ReleaseIf you find this tool helpful, please consider:
MIT © pphatdev
Made with 😧 to resolve PHP version switching issues | pphatdev
| Back | FazBrowse Home | New Git URL |