PHP Switcher is a Windows application that allows you to easily manage and switch between different PHP versions on your system. It is focused on the CLI version of PHP.
- Download and install multiple PHP versions from official repositories
- Quickly switch between installed versions with a single click
- Manage Thread Safe and Non-Thread Safe versions
- Intuitive and easy-to-use graphical interface
- Automatic environment variable configuration
- Full support for PHP 5.x, 7.x, and 8.x, including all versions and compiler formats
- Support for both x64 and x86 architectures
- Windows 10/11
- .NET 9.0 or higher
- Administrator permissions (to create symbolic links)
- Download the latest version from the releases section
- Run the installer or extract the ZIP file
- Run
PhpSwitcher.exeas administrator
- Go to the "Available Versions" tab
- Select the PHP version you want to install
- Click on "Download Selected Version(s)"
- Wait for the download and installation to complete
- Go to the "Installed Versions" tab
- Select the PHP version you want to activate
- Click on "Activate Selected Version"
- The selected version will be immediately available in the command line
- Go to the "Installed Versions" tab
- Select the PHP version you want to remove
- Click on "Remove Selected Version"
- Confirm the removal
PHP Switcher creates a symbolic link at C:\php that points to the selected PHP version. It also ensures that C:\php is in the system's PATH environment variable.
- Visual Studio 2022 or higher
- .NET 9.0 SDK
- Git
git clone https://github.com/your-username/php-Switcher.git
cd php-Switcher# Build in Debug mode (development)
dotnet build
# Build in Release mode (production)
dotnet build -c Release# Normal execution
dotnet run
# Execution with visible console (debug mode)
dotnet run -- -c
# Execution in development mode
dotnet run -- -dTo create a self-contained executable that includes all .NET dependencies:
dotnet publish -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=trueThe executable will be generated in the bin\Release\net9.0-windows\win-x64\publish\ folder.
To create an MSI installer, WiX Toolset is used:
- Install WiX Toolset:
dotnet tool install --global wix-
Create the WiX configuration file (PhpSwitcher.wxs) in the Installer folder.
-
Build the installer:
cd Installer
wix build PhpSwitcher.wxs -out PhpSwitcher.msiThe MSI installer will be generated in the Installer\ folder.
To understand the project structure, check the following files:
- structure.md - Detailed project structure
- features.md - Implemented features
- task_pending.md - Completed tasks
- CHANGELOG.md - Change history
This project is licensed under the MIT License - see the LICENSE file for details.