{"id":14982901,"url":"https://github.com/jalendport/switch-php","last_synced_at":"2025-07-16T09:36:38.726Z","repository":{"id":56034543,"uuid":"126494670","full_name":"jalendport/switch-php","owner":"jalendport","description":"Easily switch between PHP versions on your Mac. Requires Homebrew and works with Laravel Valet. 🔀","archived":false,"fork":false,"pushed_at":"2021-10-09T05:22:52.000Z","size":21942,"stargazers_count":122,"open_issues_count":10,"forks_count":27,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-29T10:13:05.580Z","etag":null,"topics":["cli","laravel-valet","php","php-versions","php5","php7","php70","php71","php72","shell","shell-script","shell-scripts","terminal","valet"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/switch-php","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jalendport.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-23T14:13:49.000Z","updated_at":"2025-04-13T14:23:18.000Z","dependencies_parsed_at":"2022-08-15T11:50:46.516Z","dependency_job_id":null,"html_url":"https://github.com/jalendport/switch-php","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/jalendport/switch-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jalendport%2Fswitch-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jalendport%2Fswitch-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jalendport%2Fswitch-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jalendport%2Fswitch-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jalendport","download_url":"https://codeload.github.com/jalendport/switch-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jalendport%2Fswitch-php/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265500340,"owners_count":23777464,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","laravel-valet","php","php-versions","php5","php7","php70","php71","php72","shell","shell-script","shell-scripts","terminal","valet"],"created_at":"2024-09-24T14:06:22.794Z","updated_at":"2025-07-16T09:36:38.701Z","avatar_url":"https://github.com/jalendport.png","language":"Shell","readme":"# 🔀 switch-php\n\nEasily switch between PHP versions on your Mac. Requires Homebrew and works with Laravel Valet.\n\n![switch-php screencast](./switch-php.gif)\n\n\n### ⬇️️️ Installation:\n\nInstalling `switch-php` is as easy as running:\n\n```\nnpm install --global switch-php\n```\n\nIf you use Yarn, you can do this:\n\n```\nyarn global add switch-php\n```\n\nAlternatively you can move the `switch-php.sh` file from this repo into your home directory and add this line in your `.bashrc`/`.zshrc`/etc.:\n\n```\nsource ~/switch-php.sh\n```\n\n\n### ⚙ Usage:\n\nYou must have PHP installed via Homebrew in order for `switch-php` to work. `switch-php` also works really well with Laravel Valet, but Valet is not a requirement in order to use `switch-php`.\n\nHere's an example of how you would use `switch-php`:\n\n```\n$ switch-php 7.1 -v -m 512M\n```\n\n1. `switch-php` -\u003e The main command. (Required)\n1. `7.1` -\u003e Specify the version of PHP you want to switch too, in this case `php71`. (Required)\n1. `-v` -\u003e Request verbose output (Optional)\n1. `-m 512M` -\u003e Request a custom PHP memory setting. If you don't pass an additional arugment, the memory will be reset to the Valet default. (Optional)\n\nHere's the full list of versions/options:\n\n```bash\nUsage:\n  version [options] [arguments]\n\nOptions:\n  -h, --help      Display the help message\n  -v, --verbose   Display more info during the process\n  -m, --memory    Customize the PHP memory setting (Valet only)\n\nAvailable Versions:\n  5.6              Switch to php@5.6\n  7.0              Switch to php@7.0\n  7.1              Switch to php@7.1\n  7.2              Switch to php@7.2\n  7.3              Switch to php@7.3\n  7.4              Switch to php@7.4\n```\n\n\n### 🎛 Customizing the PHP Memory Settings:\n\n- If you don't pass an argument to `-m` or `--memory`, it will reset any previously set custom memory settings to the default Valet config.\n- Alternatively, you can pass an argument to `-m` or    `--memory` if you want to override the default Valet memory settings. For example, you can do:\n\n```\nswitch-php 7.1 -m 512M       # php@7.1 with 512MB of memory\nswitch-php 7.3 -m 2G -v      # php@7.3 with 2GB of memory; verbose output\nswitch-php 5.6 --memory=1G   # php@5.6 with 1GB of memory\n```\n\n- *Note: customizing PHP memory settings currently only works for Laravel Valet users. If you don't use Valet, we hope to get this working for you as well in an upcoming release.*\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjalendport%2Fswitch-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjalendport%2Fswitch-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjalendport%2Fswitch-php/lists"}