{"id":17382987,"url":"https://github.com/wilmoore/php-version","last_synced_at":"2025-04-04T16:16:15.336Z","repository":{"id":2340622,"uuid":"3302812","full_name":"wilmoore/php-version","owner":"wilmoore","description":"stupid simple PHP version management","archived":false,"fork":false,"pushed_at":"2020-11-13T05:32:31.000Z","size":114,"stargazers_count":678,"open_issues_count":4,"forks_count":50,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-03-28T15:09:20.397Z","etag":null,"topics":["homebrew-php","php","php-version","php-versions","shell-script","version-manager"],"latest_commit_sha":null,"homepage":"https://github.com/wilmoore/php-version","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/wilmoore.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-01-30T06:29:10.000Z","updated_at":"2025-02-13T18:40:42.000Z","dependencies_parsed_at":"2022-08-06T12:15:12.455Z","dependency_job_id":null,"html_url":"https://github.com/wilmoore/php-version","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilmoore%2Fphp-version","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilmoore%2Fphp-version/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilmoore%2Fphp-version/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilmoore%2Fphp-version/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wilmoore","download_url":"https://codeload.github.com/wilmoore/php-version/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247208181,"owners_count":20901570,"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":["homebrew-php","php","php-version","php-versions","shell-script","version-manager"],"created_at":"2024-10-16T07:40:05.161Z","updated_at":"2025-04-04T16:16:15.314Z","avatar_url":"https://github.com/wilmoore.png","language":"Shell","readme":"# simple PHP version switching\n\n**php-version** exposes a `php-version` command allowing developers to switch between versions of PHP.\n\n![](https://i.cloudup.com/Rl7FXze6ra.png)\n\n\n## This _IS_ for you if\n\n-   You are not satisifed with heavy handed *AMP or PPA-based installers.\n-   You [use multiple][homebrew-php] [versions][php-build] of PHP on Linux or Mac.\n-   You download [pre-compiled PHP binaries for Windows][windows-bin] (**NOTE**: this is a [bash] script so you'll need [WSL]).\n-   You want to run your automated tests against multiple PHP versions.\n-   You are a developer that works on a variety of PHP projects each requiring different versions of PHP.\n-   You want to work on the latest PHP, but expect to support prior work that was done on older PHP versions.\n\n\n## This is _NOT_ for you if\n\n-   You are content with heavy handed *AMP installers.\n-   You are provisioning a production server so you only need a single PHP install.\n-   You **NEVER** work on more than one PHP project at a time.\n-   You don't plan on supporting prior work that was done on other PHP versions.\n\n\n## Rationale\n\n**php-version** attempts to stick to the classic UNIX notion that tools should do one thing well.\n\n\u003e   While there are [smart](https://github.com/c9s/phpbrew) [alternative](https://github.com/CHH/phpenv)\n\u003e   [tools](https://sourceforge.net/p/phpfarm/wiki/Home/) that attempt to [solve](https://github.com/convissor/php_version_solution)\n\u003e   this problem, [none](https://www.gnu.org/s/stow/) of the tools I've found were simple enough for me.\n\n\n## Features\n\n-   [Homebrew installed PHP versions][homebrew-php] are picked up automatically.\n-   PHP versions installed [into `~/.phps`][build-php-vers] are picked up automatically.\n-   PHP versions listed in the `$PHP_VERSIONS` shell variable are picked up automatically.\n-   **snap versioning**: Use a partial version number (i.e. `php-version 5`) to automatically use the latest 5.x version.\n-   **per version `php.ini`**: we `export PHPRC` if a version-specific `php.ini` exists.\n-   **configurable**: `php-version --help` for details.\n-   **[bash], [zsh], and [fish]** shells actively supported; though care has been taken such that other shells are _likely_ to work as well.\n-   **tiny**: less than 200 LOC; a single function sourced via your shell's initialization file.\n\n\n## Non-Features\n\n-   no [shims][], sub-shells, symlinks or `cd` [hooks][].\n-   we won't leave files and symlinks all over the place.\n-   does not attempt to manage Apache, MySQL, etc.\n-   does not attempt to compile, build, or install PHP.\n-   does not attempt to support OS package manager installed (i.e. ppa, etc.) PHP versions.\n\n\n## Usage Examples\n\n### Switch to a specific PHP version\n\n    % php-version \u003cversion\u003e\n\n### List installed and active (*) PHP version(s)\n\n    % php-version\n      5.3.9\n      5.3.10\n      5.4.0RC8\n      5.4.0RC6\n      5.4.0\n    * 5.4.8\n\n\n## Install\n\n**[homebrew](https://brew.sh/)** (recommended for OSX users)\n\n    % brew tap wilmoore/formulae\n    % brew install php-version\n\n**cURL** (for non-OSX users or those that prefer not to use `homebrew`):\n\n    % mkdir -p $HOME/local/php-version # or your place of choice\n    % cd !$\n    % curl -# -L https://github.com/wilmoore/php-version/tarball/master | tar -xz --strip 1\n\n[Alternative (i.e. non-Homebrew) installation methods][opt-install] are documented on the wiki.\n\n\n## Setup\n\n\u003e Add one of the following to your shell's initialization file:\n\n    # Homebrew (recommended)\n    source $(brew --prefix php-version)/php-version.sh\n    php-version 5\n\n    # non-Homebrew\n    source $HOME/local/php-version/php-version.sh # or your place of choice\n    php-version 5\n\nType `php-version --help` for more configuration options such as how to add extra PHP installation paths or `php-config --version` to find out which `php` version is active.\n\n\u003e If you have PHP versions in multiple directories, you can list them in the environment variable `PHP_VERSIONS` separated by spaces as depicted below:\n\n    export PHP_VERSIONS=\"$HOME/local/php $HOME/php/versions\"\n\n**NOTE**: do this before you source `php-version.sh`:\n\n## Deactivate / Uninstall\n\n1. Remove [setup](https://github.com/wilmoore/php-version#setup) configuration.\n\n2. Enter one of the following commands listed below to remove associated files.\n\n        # Homebrew (recommended)\n        % brew remove --force php-version\n\n        # non-Homebrew\n        % rm -rf $HOME/local/php-version\n\n\n## Having Issues?\n\n1. Copy the bug report output to your clipboard (`pbcopy` works on Mac OSX; use your OS equivalent)\n\n        % cd /tmp\n        % git clone https://github.com/wilmoore/php-version.git\n        % source php-version/bug-report.sh | pbcopy\n\n2. File an [issue](https://github.com/wilmoore/php-version/issues?state=open).\n\n\n## More Info\n\n-   [Building PHP Versions][build-php-vers]\n-   [Exploring PHP][exploring]\n-   [Troubleshooting][trouble]\n\n\n## Contributors\n\u003e https://github.com/wilmoore/php-version/graphs/contributors\n\n\n## Alternatives\n\n-   [brew-php-switcher](https://github.com/philcook/brew-php-switcher)\n-   [phpbrew](https://github.com/c9s/phpbrew)\n-   [phpenv](https://github.com/CHH/phpenv)\n-   [phpenv](https://github.com/humanshell/phpenv)\n-   [php_version_solution](https://github.com/convissor/php_version_solution)\n-   [phpfarm](https://sourceforge.net/p/phpfarm/wiki/Home/)\n-   [GNU Stow](https://www.gnu.org/s/stow/)\n-   [phpswitch](https://github.com/jubianchi/phpswitch)\n\n\n## Inspiration\n\n-   [n](https://github.com/visionmedia/n)\n-   [nvm](https://github.com/creationix/nvm)\n-   [rbenv](https://github.com/sstephenson/rbenv)\n-   [rbfu](https://github.com/hmans/rbfu)\n-   [ry](https://github.com/jayferd/ry)\n\n\n## LICENSE\n\n  MIT\n\n\n\n[bash]:             https://www.gnu.org/software/bash/\n[build-php-vers]:   https://github.com/wilmoore/php-version/wiki/Building-PHP-Versions\n[exploring]:        https://github.com/wilmoore/php-version/wiki/Exploring-PHP\n[fish]:             https://fishshell.com/\n[homebrew-php]:     https://github.com/josegonzalez/homebrew-php\n[hooks]:            https://rvm.io/workflow/hooks\n[manual-build]:     https://github.com/wilmoore/php-version#compilation-recommendations\n[opt-install]:      https://github.com/wilmoore/php-version/wiki/Installing\n[php-build]:        https://github.com/CHH/php-build\n[shims]:            https://github.com/sstephenson/rbenv#understanding-shims\n[trouble]:          https://github.com/wilmoore/php-version/wiki/Troubleshooting\n[windows-bin]:      http://windows.php.net/download\n[windows-port]:     https://github.com/wilmoore/php-version/issues/2\n[WSL]:              https://docs.microsoft.com/en-us/windows/wsl/install-win10\n[zsh]:              https://www.zsh.org/\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilmoore%2Fphp-version","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwilmoore%2Fphp-version","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilmoore%2Fphp-version/lists"}