Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/philcook/brew-php-switcher
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.
https://github.com/philcook/brew-php-switcher
homebrew php shell
Last synced: 6 days ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/philcook/brew-php-switcher
- Owner: philcook
- License: mit
- Created: 2014-03-12T17:24:42.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2024-05-15T03:46:25.000Z (7 months ago)
- Last Synced: 2024-10-25T03:46:40.600Z (about 2 months ago)
- Topics: homebrew, php, shell
- Language: Shell
- Homepage:
- Size: 71.3 KB
- Stars: 961
- Watchers: 21
- Forks: 90
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-php - Brew PHP Switcher - Brew PHP switcher. (Configuration / PHP Installation)
- awesome-php-cn - Brew PHP Switcher - 酿造PHP切换器. (配置 Configuration / PHP安装 PHP Installation)
- awesome-projects - Brew PHP Switcher - Brew PHP switcher. (Configuration / PHP Installation)
- awesome-php - Brew PHP Switcher - Brew PHP switcher. (Configuration / PHP Installation)
README
Brew PHP Switcher [![CI](https://github.com/philcook/brew-php-switcher/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/philcook/brew-php-switcher/actions/workflows/ci.yml)
=========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.
```sh
#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.
```sh
#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
--------------
```sh
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**, **8.0**, **8.1**, **8.2**, **8.3** or **8.4** depending on which version is required.
```sh
brew-php-switcher 5.6
```> by default will switch apache config
Options
--------------- `-s|-s=*` Skips apache & valet config switch for i.e
```sh
# 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```sh
# 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
[Homebrew]:http://brew.sh/
[@p_cook]:http://twitter.com/p_cook