{"id":50705177,"url":"https://github.com/devhardiyanto/phpvm","last_synced_at":"2026-06-09T11:00:51.818Z","repository":{"id":356874873,"uuid":"1234327381","full_name":"devhardiyanto/phpvm","owner":"devhardiyanto","description":null,"archived":false,"fork":false,"pushed_at":"2026-06-09T08:43:04.000Z","size":62,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-09T09:24:00.652Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devhardiyanto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-10T03:21:38.000Z","updated_at":"2026-06-09T08:24:15.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/devhardiyanto/phpvm","commit_stats":null,"previous_names":["devhardiyanto/phpvm"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/devhardiyanto/phpvm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devhardiyanto%2Fphpvm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devhardiyanto%2Fphpvm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devhardiyanto%2Fphpvm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devhardiyanto%2Fphpvm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devhardiyanto","download_url":"https://codeload.github.com/devhardiyanto/phpvm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devhardiyanto%2Fphpvm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34103357,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2026-06-09T11:00:26.025Z","updated_at":"2026-06-09T11:00:51.807Z","avatar_url":"https://github.com/devhardiyanto.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# phpvm — PHP Version Manager\n\nInstall and switch PHP versions on **Windows** (CMD + PowerShell) and **Linux** (bash/zsh), without admin rights.\n\n---\n\n## Installation\n\n### Windows\n\n```powershell\n# Download both files (phpvm.ps1 + install.ps1) to the same folder, then:\n.\\install.ps1\n```\n\nRestart your terminal. No admin required.\n\n### Linux\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/devhardiyanto/phpvm/main/linux/install.sh | bash\nsource ~/.bashrc\n```\n\nOr manually:\n\n```bash\ngit clone https://github.com/devhardiyanto/phpvm.git ~/.phpvm-src\nsource ~/.phpvm-src/linux/phpvm.sh\n```\n\n---\n\n## Usage\n\n### Version Management\n\n```bash\nphpvm install 8.3.0        # install a specific PHP version\nphpvm install 8.3          # install latest 8.3.x patch (auto-resolves)\nphpvm install 7.3          # works for older lines (7.x, 5.x)\nphpvm use 8.3.0            # switch active version\nphpvm list                 # list installed versions\nphpvm current              # show active version\nphpvm uninstall 8.1.29     # remove a version\nphpvm which                # path to active php binary\nphpvm ini                  # open php.ini in editor\n```\n\n### Auto-Switch with `.phpvmrc` (Windows)\n\nDrop a `.phpvmrc` file in your project root containing the PHP version you want:\n\n```bash\necho \"8.3\" \u003e .phpvmrc\n```\n\nThen run `phpvm auto` from anywhere in the project — phpvm walks up to find the nearest `.phpvmrc` and prepends that version to your shell `PATH` (session only, your global `phpvm use` is untouched).\n\nFor hands-off switching, install the PowerShell prompt hook:\n\n```powershell\nphpvm hook install      # adds a snippet to $PROFILE\n# restart PowerShell, then `cd` between projects - phpvm auto-switches per directory\nphpvm hook status       # check whether the hook is installed\nphpvm hook uninstall    # remove the hook\n```\n\n`.phpvmrc` accepts a full semver (`8.3.0`), a major.minor (`8.3` — picks the highest installed patch), or a leading `v` (`v8.3.0`). Lines starting with `#` are comments. If the version is not installed locally, phpvm warns but never auto-installs.\n\n### Extension Management\n\n```bash\n# List / inspect\nphpvm ext list             # all bundled extensions (ON/OFF)\nphpvm ext loaded           # currently loaded (php -m)\nphpvm ext info redis       # details about an extension\n\n# Enable/disable bundled extensions (edit php.ini)\nphpvm ext enable  mbstring\nphpvm ext enable  pdo_mysql\nphpvm ext enable  curl\nphpvm ext enable  zip\nphpvm ext disable pdo_sqlite\n\n# Install PECL extensions\nphpvm ext install redis\nphpvm ext install imagick\nphpvm ext install mongodb\nphpvm ext install mongodb 1.17.0   # specific version\n\n# XDebug (Windows: from xdebug.org | Linux: via PECL)\nphpvm ext install xdebug\n```\n\n---\n\n## How It Works\n\n### Windows\n- Downloads PHP binaries from [windows.php.net](https://windows.php.net/downloads/releases/)\n- Stores versions in `%USERPROFILE%\\.phpvm\\versions\\\u003cversion\u003e\\`\n- Switches via a **directory junction** (`mklink /J`) — no admin needed\n- Extensions installed from [windows.php.net PECL](https://windows.php.net/downloads/pecl/releases/)\n- XDebug fetched directly from [xdebug.org](https://xdebug.org/files/)\n\n### Linux\n- Builds PHP from source ([php.net](https://www.php.net/distributions/))\n- Stores versions in `~/.phpvm/versions/\u003cversion\u003e/`\n- Switches via symlink (`~/.phpvm/current`) prepended to `$PATH`\n- Extensions installed via `pecl`, enabled via per-version `conf.d/` drop-ins\n\n---\n\n## Linux: Build Dependencies\n\nRun `phpvm deps` to print the install command for your distro.\n\n**Ubuntu / Debian:**\n```bash\nsudo apt-get install -y \\\n  build-essential autoconf bison re2c pkg-config \\\n  libxml2-dev libsqlite3-dev libssl-dev libcurl4-openssl-dev \\\n  libonig-dev libzip-dev zlib1g-dev libreadline-dev \\\n  libpng-dev libjpeg-dev libwebp-dev libfreetype6-dev \\\n  libgmp-dev libmysqlclient-dev libpq-dev\n```\n\n---\n\n## Repository Structure\n\n```\nphpvm/\n├── windows/\n│   ├── phpvm.ps1          # main script\n│   └── install.ps1        # installer\n├── linux/\n│   ├── phpvm.sh           # main script (sourced in .bashrc)\n│   └── install.sh         # curl installer\n└── README.md\n```\n\n## Install Directory Structure\n\n```\n~/.phpvm/\n├── versions/\n│   ├── 8.3.0/         # Windows: php.exe lives here\n│   │                  # Linux:   bin/php lives here\n│   └── 8.1.29/\n├── current -\u003e versions/8.3.0   (junction on Windows, symlink on Linux)\n├── cache/             # Linux: cached source tarballs\n├── bin/               # Windows: phpvm.cmd + phpvm.ps1 shim\n├── phpvm.ps1          # Windows: main script\n└── phpvm.sh           # Linux: main script (sourced in .bashrc)\n```\n\n---\n\n## Environment Variables\n\n| Variable | Default | Description |\n|---|---|---|\n| `PHPVM_DIR` | `~/.phpvm` | phpvm home directory |\n| `EDITOR` | `nano` | Editor used by `phpvm ini` (Linux) |\n| `PHPVM_SKIP_HASH` | _unset_ | When set to `1`, skip SHA-256 verification on Windows installs (use for content-rewriting corporate proxies) |\n| `PHPVM_NO_UPDATE_CHECK` | _unset_ | When set, skip the daily phpvm update check |\n| `PHPVM_AUTO_ACTIVE` | _unset_ | Internal: tracks the version currently pinned by `phpvm auto` in the current shell |\n\n---\n\n## Compatibility\n\n| Platform | Shell | Status |\n|---|---|---|\n| Windows 10/11 | CMD | ✅ |\n| Windows 10/11 | PowerShell 5+ | ✅ |\n| Ubuntu 20.04+ | bash / zsh | ✅ |\n| Debian 11+ | bash / zsh | ✅ |\n| Fedora / RHEL | bash / zsh | ✅ |\n| Arch Linux | bash / zsh | ✅ |\n\n---\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevhardiyanto%2Fphpvm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevhardiyanto%2Fphpvm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevhardiyanto%2Fphpvm/lists"}