PHP Version Manager for the CLI on Windows

Overview

PVM for Windows

Removing the hassle of changing PHP versions in the CLI on Windows.

This package has a much more niche use case than nvm does. When developing on Windows and using the integrated terminal, it's quite difficult to get those terminals to actually listen to PATH changes.

This utility changes that.

Installation

The installation process is a little convoluted. You need PHP already installed for it to work, which I admit isn't ideal.

composer global require hjbdev/pvm

Type pvm discover, then copy the path from pvm path and paste it into your path in the Windows Environment variables.

Commands

pvm discover 

The path variable is optional, by default it will go to the Laragon bin folder (C:\laragon\bin\php). Provide a path to where all your PHP installations are.

pvm list

Will list out all the available PHP versions you have

pvm path

Will tell you what to put in your Path variable.

pvm use 7.1

Will switch your currently active PHP version to PHP 7.1

pvm clear

Clears all the detected php versions from pvm discover

Comments
  • Error when changing PHP version

    Error when changing PHP version

    Hello

    • I installed the tool with PHP 7.3 in my PATH
    • I removed my PHP to the path else when i use php --version i still have my php 7.3 used
    • I added the path to hjbdev\pvm\bin in my PATH folder

    But when i have changed my PHP version with pvm use 7.2 (or another version) and i try to use a new version I have this error

    Fatal error: Declaration of Illuminate\Container\Container::get($id) must be compatible with Psr\Container\ContainerInterface::get(string $id) in C:\Users\Julien\AppData\Roaming\Composer\vendor\illuminate\container\Container.php on line 15

    I guess it's a dependency & PHP version issue

    bug 
    opened by JulienRAVIA 8
  • Fix autoload clashes in helpers.php

    Fix autoload clashes in helpers.php

    Fix composer autoload error Fatal error: Cannot redeclare dd or Fatal error: Cannot redeclare dump

    I get the following error after I did a clean install with composer global require hjbdev/pvm

    Fatal error: Cannot redeclare dump() (previously declared in C:\Users\me\AppData\Roaming\Composer\vendor\symfony\var-dumper\Resources\functions\dump.php:18) in C:\Users\me\AppData\Roaming\Composer\vendor\hjbdev\pvm\bootstrap\helpers.php on line 61
    

    I have other globally installed packages too in this case symfony's helpers are clashing with pvm helpers this fix should resolve the problem

    opened by Eboubaker 1
  • Broaden Compatibility, Minimise Dependency Issues

    Broaden Compatibility, Minimise Dependency Issues

    Laravel Zero is great, but it's also got a lot of dependencies.

    With this package being quite dependent on being version-agnostic, this has caused some issues :(

    I'm going to try and strip out all unnecessary dependencies to hopefully solve #3

    opened by hjbdev 0
  • MacOS support

    MacOS support

    The only thing stopping pvm from being cross platform (I believe) was the PHP version checking code.

    I've rewritten it to work on any platform. Verifying tomorrow.

    #2

    opened by hjbdev 0
  • Installation Tweaks

    Installation Tweaks

    Suggestions to installation process:

    Install the package

    pvm setup

    • Will update your path for you
    • Remove any other PHPs in there
    • Advise you to log out / restart computer

    pvm use (optional string)

    • if string == null - list out installs and you can choose the ID you want
    • if string - change to that version

    pvm laragon-use (optional string)

    • same as 'use' but will also update laragon

    pvm php-install

    • shows list of php versions available
    • select ID you want
    • downloads to laragon and unzips

    pvm remove

    • removes the link from the path file (important this one!)

    Might be nice ones:

    pvm addtopath

    • shows all the php versions available
    • choose the oen you want by id
    • will add that php version to the path and ensure that the symbolic one isnt there
    enhancement 
    opened by matyhaty 5
Releases(0.2.3)
  • 0.2.3(Mar 8, 2022)

    Changes:

    • Added function_exists checks to stop pvm interfering with other globally installed packages #9 , #10 (Thanks @Eboubaker!)
    • Hid some deprecation warnings introduced in PHP 8.1. I will review this at a later date, it may result in me dropping support for PHP 5.6, which I shouldn't really be supporting anyway. #10
    Source code(tar.gz)
    Source code(zip)
  • 0.2.2(Aug 29, 2021)

  • 0.2.1(Apr 30, 2021)

  • 0.2.0(Apr 30, 2021)

    I've rewritten the package from the ground up to no longer rely on Laravel Zero.

    I'm bummed out by this because Zero is great, but I needed a wide range of compatibility and some of Zero's dependencies were making this difficult.

    Source code(tar.gz)
    Source code(zip)
Owner
Harry Bayliss
Harry Bayliss
☄️ PHP CLI mode development framework, supports Swoole, WorkerMan, FPM, CLI-Server

☄️ PHP CLI mode development framework, supports Swoole, WorkerMan, FPM, CLI-Server / PHP 命令行模式开发框架,支持 Swoole、WorkerMan、FPM、CLI-Server

Mix PHP 1.8k Jan 3, 2023
Bash version of the VK client written in PHP.

VK-CLI VK Messenger in your Linux Terminal PHP8 Installation wget https://jenkins.pmmp.io/job/PHP-8.0-Aggregate/lastSuccessfulBuild/artifact/PHP-8.0-L

David Ratnikov 4 Nov 5, 2022
🖥 Build beautiful PHP CLI menus. Simple yet Powerful. Expressive DSL.

Contents Minimum Requirements Installation Upgrading Usage Quick Setup Examples API Appearance Menu Title Colour Width Padding Margin Borders Exit But

PHP School 1.9k Dec 28, 2022
An Elegant CLI Library for PHP

Commando An Elegant PHP CLI Library Commando is a PHP command line interface library that beautifies and simplifies writing PHP scripts intended for c

Nate Good 793 Dec 25, 2022
Cilex a lightweight framework for creating PHP CLI scripts inspired by Silex

Cilex, a simple Command Line Interface framework Cilex is a simple command line application framework to develop simple tools based on Symfony2 compon

null 624 Dec 6, 2022
PHP CLI tool which allows publishing zipped MODX extra to modstore.pro marketplace

MODX Extra Publisher PHP CLI tool which allows publishing zipped MODX extra to modstore.pro marketplace. Installation global? local? To install packag

Ivan Klimchuk 3 Aug 6, 2021
PHP CLI project to get an appointment from https://vacunacovid.catsalut.gencat.ca

covid_vaccine_bcn PHP CLI project to get an appointment from https://citavacunacovid19.catsalut.gencat.cat/Vacunacio_Covid/Vacunacio/VacunacioCovidRes

Gabriel Noé González 3 Jul 27, 2021
PHP CLI to add latest release notes to a CHANGELOG

changelog-updater A PHP CLI to update a CHANGELOG following the "Keep a Changelog" format with the latest release notes. Want to automate the process

Stefan Zweifel 15 Sep 21, 2022
unofficial cli built using php which can be used to upload and download files from anonfiles.com

Anonfiles CLI Table of Contents Introduction Features Screenshots Installation Contributing License Introduction Anon Files CLI can upload and downloa

Albin Varghese 8 Nov 21, 2022
Library for creating CLI commands or applications

Console Motivation: this library purpose is to provide a lighter and more robust API for console commands and/or applications to symfony/console. It c

Théo FIDRY 16 Dec 28, 2022
A handy set of Stringable mixins for CLI text.

Laravel Colorize A mixin for Laravel's Stringable to easily apply colors and styles to CLI text. Installation You can install the package via Composer

James Brooks 47 Oct 30, 2022
WP-CLI Trait Package Command

WP-CLI Trait Package Command Generate plugin or php model files e.g. post-type or taxonomy for WP-Trait Package in Develop WordPress Plugin. Installat

Mehrshad Darzi 2 Dec 17, 2021
A CLI program that helps you check your endpoints by requesting the given servers and send a report message in any supported channel like Telegram

API Monitor A CLI program that help you check your endpoints by requesting the given servers and send a report message in any supported channel ( Tele

Hussein Feras 51 Aug 21, 2022
Termage provides a fluent and incredibly powerful object-oriented interface for customizing CLI output text color, background, formatting, theming and more.

Termage provides a fluent and incredibly powerful object-oriented interface for customizing CLI output text color, background, formatting, theming and

TERMAGE 75 Dec 20, 2022
A CLI starter pack for developing a package with Laravel 5

Laravel PackMe Laravel PackMe is a project starter pack which combine all basic stuff (src, tests) in order to develop a package for Laravel 5.*. It t

Pierre Tondereau 63 Dec 29, 2021
PHPFusion CLI

PHPFusion CLI Installation Source Add path\to\PF-CLI\bin to your system PATH .phar file Download pf.phar Check the Phar file to verify that it's worki

PF Projects 0 Mar 20, 2022
Drupal.org Git CLI

doGit Drupal.org + Git CLI application. doGit assists in making the transition to merge requests, and general Git operations, easier for Drupal develo

dpi 16 Dec 15, 2022
A Magento 2 module that adds a CLI bin/magento cms:dump to dump all CMS pages and CMS blocks to a folder var/cms-output.

A Magento 2 module that adds a CLI bin/magento cms:dump to dump all CMS pages and CMS blocks to a folder var/cms-output.

Yireo 16 Dec 16, 2022