Skip to content

Latest commit

 

History

19 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

windows-php-switcher

PHP Switcher is a simple python tool that allows you to switch between php versions by modifying the system environment variable "PATH" to tell windows where the disired php is.

program picture

Installation

  • clone the repo

    git clone https://github.com/maged909/windows-php-switcher.git
    

    or download it you can also look up the Releases :)

  • change the current directory to windows-php-switcher

    cd windows-php-switcher
    
  • install python requirements

    pip install -r requirements.txt
    

Requirements

colorama==0.4.6
tabulate==0.9.0

Configration

Go to config.js and add the php versions you want with their absolute path here's an example

{
"php7.3": {
    "selection": "1", 
    "path": "C:\\xampp\\php"
},
"php8.2.3": {
    "selection": "2",
    "path": "C:\\xampp\\php823"
}
}

here i have two php versions php7.3 and php8.2.3 each one with their selection that would show in menu and their path that would be used in the environment variable i'm here using php in my xampp folder but you can point to wherever you have the php

Config Notes

  • each php version must have selection and path
  • selection must be unique for each php version
  • path must be a valid absolute path to the php folder not file and cannot contain ";"

Usage

to use it just run the phpSwitcher.py on a terminal that has an adminstrator permissions

python phpSwitcher.py

or you can simply double click the phpSwitcher.py file :)

  • keep in mind that the script would ask for primission that's just coz it needs that to modify the system environment variable "PATH"
  • after choosing the selection and changing the php any already opened terminals would still be working with the old php so you need to restart them

About

PHP Switcher is a simple tool that allows you to switch between php versions by modifying the system environment variable "PATH" to tell windows where the disired php is.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages