Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vinugawade/s-php
Easily switch PHP versions on Linux.
https://github.com/vinugawade/s-php
apache2 bash bash-script cli command-line-tool github linux macos open-source opensource php shell-script utility
Last synced: 1 day ago
JSON representation
Easily switch PHP versions on Linux.
- Host: GitHub
- URL: https://github.com/vinugawade/s-php
- Owner: vinugawade
- License: mit
- Created: 2022-08-10T20:50:31.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-01-22T03:33:22.000Z (12 months ago)
- Last Synced: 2024-01-22T04:32:23.990Z (12 months ago)
- Topics: apache2, bash, bash-script, cli, command-line-tool, github, linux, macos, open-source, opensource, php, shell-script, utility
- Language: Shell
- Homepage: https://vinugawade.github.io/s-php
- Size: 381 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# s-php :- version switcher for linux
![OS](https://img.shields.io/badge/Linux-white?style=flat-square&logo=linux&logoColor=black)
![Bash Script](https://img.shields.io/badge/Bash_Script-121011?style=flat-square&logo=gnu-bash&logoColor=white)
![GitHub issues](https://img.shields.io/github/issues/vinugawade/s-php?style=flat-square)
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/vinugawade/s-php?style=flat-square)
![GitHub last commit](https://img.shields.io/github/last-commit/vinugawade/s-php?style=flat-square)If you're on linux system with PHP installed via apt, you may be looking for an easy way to switch between PHP versions (5.6, 7.0, 7.1, 7.2 etc) without executing multiple commands manually. Well, this package is it.
## Installation
Clone [this](https://github.com/vinugawade/s-php) repository to your local machine using below command.
```bash
git clone https://github.com/vinugawade/s-php.git
```Move the script using below command.
```bash
sudo mv /location/of/file /usr/local/bin
```Allow everyone to execute the script, use below command.
```bash
sudo chmod +x /location/of/file
```OR
```bash
sudo chmod 0755 /location/of/file
```Add `/usr/local/bin` to your `$PATH`. If you use the `Bash` shell,Then you can do this by running below command.
```bash
export PATH=$PATH:/usr/local/bin
```OR
```bash
export PATH=$PATH:/location/of/file
```This will set the variable name: potentially in a file called `~/.bash_profile`, `~/.bashrc` or `~/.profile`. The difference between these files is (primarily) when they get read by the shell. If you're not sure where to put it, then `~/.bashrc` is a good choice.
> **You may need to restart your shell for this to take effect.**
## Usage
Now you can use the script from anywhere in `Terminal`. below are some examples.
```bash
s-php 5.6
``````bash
s-php 7.4
``````bash
s-php 8.0
```Check below attached `GIF`.
![Run s-php script](https://raw.githubusercontent.com/vinugawade/s-php/7e6100d0f54c87ecc397ca320de737ad6df87e1f/docs/assets/images/Use_of_script.gif)## Mac User?
> **Check this** :- [sphp](https://github.com/jschaedl/sphp-osx) Repository.
## Contribution
### Step 1
- **Option 1**
- 🍴 Fork this repo!- **Option 2**
- 👯 Clone [this](https://github.com/vinugawade/s-php) repository to your local machine.### Step 2
- Make Changes! 🔨 ✏️ ⌨️
### Step 3
- 🔃 Create a new `Pull Request`.
## Maintainer ✨
Connect with me :-
![Made With](https://ForTheBadge.com/images/badges/built-with-love.svg)
By [Vinay Gawade](https://github.com/vinugawade).
---
## License
Check [here](LICENSE).
![LICENSE](https://img.shields.io/github/license/vinugawade/ur-cache-cleaner?style=flat-square)