GithubHelp home page GithubHelp logo

rapidwebltd / php-switch-scripts Goto Github PK

View Code? Open in Web Editor NEW
66.0 10.0 49.0 58 KB

πŸ”„ Scripts to aid in the setup of and switching between multiple PHP versions in Ubuntu 14.04 LTS or newer

License: GNU Lesser General Public License v3.0

Shell 100.00%
php php7 php5 development-tools php-versions

php-switch-scripts's Introduction

πŸ”„ PHP Switch Scripts

These scripts are designed to aid in the setup of and switching between multiple PHP versions in Ubuntu 14.04 LTS or newer.

Please note that these scripts install packages from a third-party repository, provided by OndΕ™ej SurΓ½. More details are available at the repository's website, PPA page on Launchpad and Twitter account.

Requirements

  • Ubuntu 14.04.* LTS or newer
  • Apache 2.4.*

You can check you have the required versions by running the following command.

lsb_release -a | grep Ubuntu && apache2 -v | grep Apache

You should see something similar to the below.

Description:    Ubuntu 14.04.5 LTS
Server version: Apache/2.4.18 (Ubuntu)

Setup

First, clone the repository, and change directory if you have not already done so.

git clone https://github.com/rapidwebltd/php-switch-scripts.git
cd php-switch-scripts

Next, to setup all the supported PHP versions and common PHP extensions for them, you just need to run the setup.sh script. This is shown below.

./setup.sh

This may take some time depending on your system and connection speed. It will also require you to enter your password to install new packages.

When you see a message similar to the following, setup is complete and you are ready to switch between PHP versions at will.

* Setup complete. You may now use the 'switch-to-php-*.*.sh' scripts.`

Usage

Once setup is complete, you can easily switch between different PHP versions using the appropriately named scripts. Examples are shown below.

./switch-to-php-5.6.sh
./switch-to-php-7.0.sh
./switch-to-php-7.1.sh
./switch-to-php-7.2.sh
./switch-to-php-7.3.sh
./switch-to-php-7.4.sh

This will alter the versions of PHP running in Apache and the command line. Your password will be required to enable/disable Apache modules, restart the web server and alter the default PHP CLI version.

Verification

If you wish, you can check that the switch was completed successfully.

You can verify the command line version of PHP has changed with the following command.

php -v | grep PHP

You can check the version of PHP running in Apache by creating a new PHP file, that calls the phpinfo() method, then accessing it via a web browser. An example is shown below.

<?php phpinfo(); ?>

php-switch-scripts's People

Contributors

divineomega avatar luizpinheiro avatar nafiesl avatar samael avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

php-switch-scripts's Issues

Adding PHP 8.0, 8.1, 8.2

Exactly it's not a problem but a feature to give support to the rest of the PHP version from 8.0 to 8.2.

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.