Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

PHP Version Manager (phpvm)

phpvm is a command-line tool to manage multiple PHP versions on your Linux system, inspired by nvm for Node.js. It allows you to easily install, switch, list, and remove PHP versions.

Features

  • Install specific PHP versions or the latest version.
  • Switch between installed PHP versions.
  • List all installed PHP versions.
  • Display the current active PHP version.
  • Remove specific PHP versions.
  • Remove all installed PHP versions.

Installation

  • You can install phpvm using the one-liner command below:

    bash -c "$(curl -fsSL https://raw.githubusercontent.com/meer-sagor/phpvm/master/install_phpvm.sh)"

Usage

Install PHP

  • Install the latest PHP version:

    phpvm install
  • Install a specific PHP version:

    phpvm install <php-version>

    Example:

    phpvm install 7.4

Switch PHP Version

  • Switch to a specific PHP version:
    phpvm switch <php-version>
    Example:
    phpvm switch 8.0

List Installed PHP Versions

  • List all installed PHP versions:
    phpvm list

Current PHP Version

  • Show the current active PHP version:

    phpvm current
  • Remove a specific PHP version:

    phpvm remove <php-version>

    Example:

    phpvm remove 7.4

Remove All PHP Versions

  • Remove all installed PHP versions:
    phpvm remove_all

Notes

  • This script uses the Ondřej Surý PPA for PHP versions. Make sure you have sudo privileges to install, switch, and remove PHP versions.
  • After switching PHP versions, the script will attempt to restart Apache or Nginx services if they are installed and configured to use PHP.

Contributing

Contributions are welcome! Please fork the repository and submit a pull request with your changes.

License

This project is licensed under the MIT License.

About

phpvm is a command-line tool to manage multiple PHP versions on your Linux system, inspired by nvm for Node.js. It allows you to easily install, switch, list, and remove PHP versions.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages