{"id":16329289,"url":"https://github.com/arueckauer/pvs","last_synced_at":"2026-04-25T11:34:26.931Z","repository":{"id":139232232,"uuid":"189273723","full_name":"arueckauer/pvs","owner":"arueckauer","description":"PHP version switcher for Windows (PowerShell Module)","archived":false,"fork":false,"pushed_at":"2020-12-03T06:19:28.000Z","size":18,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-20T00:12:31.726Z","etag":null,"topics":["php","powershell","version-switcher"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause-clear","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arueckauer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2019-05-29T17:56:19.000Z","updated_at":"2022-10-02T01:10:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"b82447a2-ae21-4853-b6da-eb529ee0cdad","html_url":"https://github.com/arueckauer/pvs","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/arueckauer/pvs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arueckauer%2Fpvs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arueckauer%2Fpvs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arueckauer%2Fpvs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arueckauer%2Fpvs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arueckauer","download_url":"https://codeload.github.com/arueckauer/pvs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arueckauer%2Fpvs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32261116,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T09:15:33.318Z","status":"ssl_error","status_checked_at":"2026-04-25T09:15:31.997Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["php","powershell","version-switcher"],"created_at":"2024-10-10T23:15:01.634Z","updated_at":"2026-04-25T11:34:26.910Z","avatar_url":"https://github.com/arueckauer.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP version switcher for Windows (PowerShell Module)\n\nThis project offers version switching functionality of locally installed PHP\nversions as a PowerShell module.\n\nIt assumes PHP is used as an Apache module and restarts the Apache service\nafter a version switch. This process can easily be adjusted, if PHP-FPM or any\nanother setup is used.\n\n## Installation\n\nThe following instructions describe the installation of the module for the\ncurrent user.\n\n### Download and move module to modules path\n\nDownload the latest [release](https://github.com/arueckauer/pvs/releases) and\nextract it to a temporary directory. To use the latest version, clone the\nrepository instead.\n\nCreate a path for the module. If applicable replace `1.1.0` with the actual\ndownloaded version.\n\n```powershell\nNew-Item -Type Directory -Path $HOME\\Documents\\WindowsPowerShell\\Modules\\pvs\\1.1.0\n```\n\nCopy `src\\pvs.psd1` and `src\\pvs.psm1` module to its new home.\n\n```powershell\nCopy-Item C:\\path\\to\\pvs\\pvs.* -Destination $HOME\\Documents\\WindowsPowerShell\\Modules\\pvs\\1.1.0\\\n```\n\n### Import module\n\nThe restart of the Apache service, requires elevated rights. That is why this\nmodule will only be imported in elevated PowerShell sessions. Loading and\nexecuting the pvs in a non-elevated PowerShell will fail the to restart the\nApache service.\n\nAdd the following lines to the `profile.ps1`. To learn more about the\nPowerShell profiles and their locations, read [about_profiles](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_profiles?view=powershell-7).\n\n```powershell\n$currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())\nif ($currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {\n    Import-Module pvs\n}\n```\n\n## Configuration\n\nThe pvs comes with a configuration, which assumes various PHP versions are\ninstalled in `C:\\webserv`. You can adjust this configuration to your needs.\n\nFor the \"active\" version a symlink is set to `C:\\webserv`. This path is set in\nthe PATH environment variable and the Apache configuration is referencing the\nsymlink instead of the actual path.\n\nTo support both PHP 7 and PHP 8 releases, two configuration files for Apache\nhttpd are required. Dependeing on the used major PHP version either one is\nreferenced by a symlink.\n\n`httpd-php7.conf`\n\n```\n# Load PHP7 Module\nAddHandler application/x-httpd-php .php\nAddType application/x-httpd-php .php .html\nLoadModule php7_module \"C:/webserv/php/php7apache2_4.dll\"\nPHPIniDir \"C:/webserv/php\"\n```\n\n`httpd-php8.conf`\n\n```\n# Load PHP8 Module\nAddHandler application/x-httpd-php .php\nAddType application/x-httpd-php .php .html\nLoadModule php_module \"c:/webserv/php/php8apache2_4.dll\"\nPHPIniDir \"c:/webserv/php\"\n```\n\n\u003e Note: As of PHP 8, the module no longer includes the major version number.\n\u003e See https://bugs.php.net/bug.php?id=78681\n\nIn `src\\pvs.psm1` you can configure the available versions and their paths. For\nexample:\n\n```powershell\n    $apacheConfigPath = \"C:\\webserv\\httpd-2.4.41-win64-VS16\\Apache24\\conf\\\"\n    $apacheConfigFile = $apacheConfigPath + \"httpd.conf\"\n    $apacheConfigTarget = $apacheConfigPath + \"httpd-php7.conf\"\n\n    switch ($version) {\n        \"7.0\" {\n            $phpPath = \"C:\\webserv\\php-7.0.33-Win32-VC14-x64\"\n        }\n        \"7.1\" {\n            $phpPath = \"C:\\webserv\\php-7.1.33-Win32-VC14-x64\"\n        }\n        \"7.2\" {\n            $phpPath = \"C:\\webserv\\php-7.2.32-Win32-VC15-x64\"\n        }\n        \"7.3\" {\n            $phpPath = \"C:\\webserv\\php-7.3.20-Win32-VC15-x64\"\n        }\n        \"7.4\" {\n            $phpPath = \"C:\\webserv\\php-7.4.8-Win32-vc15-x64\"\n        }\n        \"8.0\" {\n            $phpPath = \"C:\\webserv\\php-8.0.0alpha3-Win32-vs16-x64\"\n            $apacheConfigTarget = $apacheConfigPath + \"httpd-php8.conf\"\n        }\n        Default { throw \"Provided PHP version $version is not supported\" }\n    }\n```\n\nThis configuration shows a setup of all the latest PHP 7 minor versions and the\nlatest QA release of PHP 8. It is possible to have multiple patch version of\nthe same minor installed by providing the full version number, e.g. `7.4.6`.\n\n## Usage\n\nOpen an elevated PowerShell, invoke `pvs` and provide the version as parameter.\n\n```powershell\nC:\\source\u003e pvs 7.4\nPHP Version Switcher 1.1.0 by Andi Rückauer\n\nSwitching to version: 7.4...\n\nRemoving SymbolicLink...\n\nCreating SymbolicLink...\n\n\n\n    Verzeichnis: C:\\webserv\n\n\nMode                 LastWriteTime         Length Name\n----                 -------------         ------ ----\nd----l        26.06.2020     09:15                php\nRestarting Apache...\n\nWARNUNG: Warten auf Beendigung des Diensts \"Apache2.4 (Apache2.4)\"...\n\n\nC:\\source\u003e php -v\nPHP 7.4.8 (cli) (built: Jun  9 2020 13:36:15) ( ZTS Visual C++ 2017 x64 )\nCopyright (c) The PHP Group\nZend Engine v3.4.0, Copyright (c) Zend Technologies\n    with Xdebug v2.9.0, Copyright (c) 2002-2019, by Derick Rethans\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farueckauer%2Fpvs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farueckauer%2Fpvs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farueckauer%2Fpvs/lists"}