Giter Club home page Giter Club logo

phplink's Introduction

phplink - a tool to link against a specific PHP version

phplink is a cli tool to link against a specific PHP version.

What does that mean?

The purpose of phplink is easily allowing switching from one PHP version to another one.

For instance, say we have locally installed PHP versions 7.4, 8.0 and 8.1 and our current PHP cli is linked/pointed to version 7.4 and we want to easily switch to version 8.1. By using phplink, one could simply do sudo phplink 8.1 and everything should work just fine.

asciicast

Why?

Because who needs Docker anyway?

Requirements

  • GNU bash, version 5+

Instalation

Below is the easiest way to install this tool:

wget https://raw.githubusercontent.com/chapeupreto/phplink/main/phplink
sudo mv -v phplink /usr/local/bin
chmod +x /usr/local/bin/phplink

After those steps, phplink is supposed to be available globally on your system. You can check if everything is OK with:

phplink --help

Usage

phplink can be used to link against a specific PHP version by just doing

sudo phplink <php-version>

As an example, assuming PHP 8.0 is already installed, one could do the following in order to link against it:

sudo phplink 8.0

After doing that, the output of php -v should display something regarding PHP version 8.0.

One can use the -l (--list) flag in order to see all available PHP versions:

phplink -l

There is also the -h (--help) flag that shows a little help about how to use this tool.

Notes

This tool was tested on Ubuntu 20.04.2 LTS where all PHP versions were installed through apt.

phplink's People

Contributors

chapeupreto avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.