Giter Club home page Giter Club logo

bit7works / brew-php-switcher Goto Github PK

View Code? Open in Web Editor NEW

This project forked from philcook/brew-php-switcher

0.0 0.0 0.0 87 KB

Brew PHP switcher is a simple shell script to switch your apache and CLI quickly between major versions of PHP. If you support multiple products/projects that are built using either brand new or old legacy PHP functionality. For users of Homebrew (or brew for short) currently only.

License: MIT License

Shell 100.00%

brew-php-switcher's Introduction

Brew PHP Switcher CI

Brew PHP switcher is a simple script to switch your Apache and CLI configs quickly between major versions of PHP.

If you support multiple products/projects that are built using either brand new or old legacy PHP functionality and you find it a pain to change config files continually this will make the whole process just one command.

Caveats

For users of OSX only who have installed PHP via Homebrew and for PHP version 5.6, 7.0, 7.1, 7.2, 7.3, 7.4 and 8.0 only.

Your Apache config must have native osx PHP module commented out.

#LoadModule php5_module libexec/apache2/libphp5.so

Brew PHP Switcher will automatically add the Homebrew's PHP module location in the Apache config in the following format.

#LoadModule php5_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp5.so
#LoadModule php7_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp7.so
#LoadModule php7_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp7.so
#LoadModule php7_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp7.so
#LoadModule php7_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp7.so
#LoadModule php7_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp7.so
#LoadModule php7_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp8.so

Version

2.3

Installation

brew install brew-php-switcher

Where 5.6 exists, please replace with syntax of 5.6, 7.0, 7.1, 7.2, 7.3, 7.4 or 8.0 depending on which version is required.

brew-php-switcher 5.6

by default will switch apache config

Options

  • -s|-s=* Skips apache & valet config switch for i.e
# skip apache only
brew-php-switcher 5.6 -s

# skip valet only
brew-php-switcher 5.6 -s=valet

# skip valet & apache
brew-php-switcher 5.6 -s=valet,apache
  • -c=* switch a specific config for i.e
# switch valet config only
brew-php-switcher 5.6 -c=valet

# switch valet & apache config only
brew-php-switcher 5.6 -c=valet,apache

# switch apache config only
brew-php-switcher 5.6 -c=apache

License

MIT

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.