{"id":40721527,"url":"https://github.com/aytacmalkoc/php-use","last_synced_at":"2026-01-21T13:37:46.297Z","repository":{"id":333585350,"uuid":"1137860023","full_name":"aytacmalkoc/php-use","owner":"aytacmalkoc","description":"A simple tool that allows you to easily switch between multiple PHP versions on Windows.","archived":false,"fork":false,"pushed_at":"2026-01-20T00:10:45.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-20T07:22:09.220Z","etag":null,"topics":["bash","php","windows"],"latest_commit_sha":null,"homepage":"","language":"Batchfile","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/aytacmalkoc.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,"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-01-19T23:52:48.000Z","updated_at":"2026-01-20T00:11:22.000Z","dependencies_parsed_at":"2026-01-20T07:22:11.028Z","dependency_job_id":null,"html_url":"https://github.com/aytacmalkoc/php-use","commit_stats":null,"previous_names":["aytacmalkoc/php-use"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/aytacmalkoc/php-use","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aytacmalkoc%2Fphp-use","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aytacmalkoc%2Fphp-use/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aytacmalkoc%2Fphp-use/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aytacmalkoc%2Fphp-use/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aytacmalkoc","download_url":"https://codeload.github.com/aytacmalkoc/php-use/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aytacmalkoc%2Fphp-use/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28633774,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T04:47:28.174Z","status":"ssl_error","status_checked_at":"2026-01-21T04:47:22.943Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["bash","php","windows"],"created_at":"2026-01-21T13:37:45.657Z","updated_at":"2026-01-21T13:37:46.289Z","avatar_url":"https://github.com/aytacmalkoc.png","language":"Batchfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP Use for Windows\n\nA simple tool that allows you to easily switch between multiple PHP versions on Windows. Works with both Windows Command Prompt and Git Bash.\n\n## Features\n\n- ✅ Easy switching between multiple PHP versions\n- ✅ Windows Command Prompt support\n- ✅ Git Bash support\n- ✅ Automatic PATH management\n- ✅ Compatible with Composer and other PHP tools\n\n## Installation\n\n1. Clone or download this repository:\n```bash\ngit clone https://github.com/aytacmalkoc/php-use.git\ncd php-use\n```\n\n2. Open `bin/php-use.bat` and edit the paths to your PHP versions:\n```batch\nSET PHP_73=C:\\laragon\\bin\\php\\php-7.3.33-nts-Win32-VC15-x64\nSET PHP_82=C:\\laragon\\bin\\php\\php-8.2.27-nts-Win32-vs16-x64\nSET PHP_83=C:\\laragon\\bin\\php\\php-8.3.26-Win32-vs16-x64\nSET PHP_84=C:\\laragon\\bin\\php\\php-8.4.14-nts-Win32-vs17-x64\n```\n\n3. On first use, run `bin/php-use.bat` to add the `bin` directory to PATH:\n```bash\nbin\\php-use.bat 8.4\n```\n\n4. Open a new terminal window (required for PATH updates)\n\n### Setting up `php-use` alias (Optional)\n\nTo use `php-use` as a shorter command instead of `php-use.bat`, you can create an alias or add it to your PATH:\n\n**Windows Command Prompt:**\n- The `php-use\\bin` folder will be automatically added to PATH when you first run `php-use.bat`\n- After opening a new terminal, you can use: `php-use 8.4` (without `.bat` extension if you have file extensions enabled)\n\n**Git Bash:**\nAdd this line to your `~/.bashrc` or `~/.bash_profile`:\n```bash\nalias php-use='/c/path/to/php-use/bin/php-use.bat'\n```\n\nAfter adding the alias, reload your shell configuration:\n```bash\nsource ~/.bashrc\n# or\nsource ~/.bash_profile\n```\n\nNow you can use: `php-use 8.4`\n\n## Usage\n\n### Switching PHP Versions\n\n```bash\nphp-use.bat 8.4    # Switch to PHP 8.4\nphp-use.bat 8.3    # Switch to PHP 8.3\nphp-use.bat 8.2    # Switch to PHP 8.2\nphp-use.bat 7.3    # Switch to PHP 7.3\n```\n\nOr if you've set up the alias:\n```bash\nphp-use 8.4\n```\n\n### Using PHP Command\n\nAfter switching versions, open a new terminal and you can use the `php` command directly:\n\n```bash\nphp --version\nphp -v\ncomposer require vendor/package\n```\n\n## File Structure\n\n```\nphp-use/\n├── bin/\n│   ├── php-use.bat   # PHP version switcher script (Windows)\n│   ├── php.bat        # PHP wrapper for Windows Command Prompt\n│   └── php            # PHP wrapper script for Git Bash\n├── LICENSE\n├── README.md\n└── .gitignore\n```\n\n## How It Works?\n\n1. When `php-use.bat` is run, the selected PHP version's path is saved to the `PHP_PATH` user environment variable.\n2. The `php.bat` (Windows) and `php` (Git Bash) scripts read this environment variable and execute the correct PHP version.\n3. On first run, the `php-use\\bin` folder is automatically added to PATH.\n\n## Setting Your Own PHP Paths\n\nOpen `bin/php-use.bat` and edit the `SET PHP_XX=` lines according to your PHP installation paths:\n\n```batch\nSET PHP_73=C:\\path\\to\\your\\php-7.3\nSET PHP_82=C:\\path\\to\\your\\php-8.2\nSET PHP_83=C:\\path\\to\\your\\php-8.3\nSET PHP_84=C:\\path\\to\\your\\php-8.4\n```\n\nTo add new PHP versions, add a new `IF` block:\n\n```batch\nELSE IF \"%1\"==\"8.1\" (\n    SETX PHP_PATH \"%PHP_81%\"\n    echo Switched to PHP 8.1\n)\n```\n\n## Troubleshooting\n\n### Getting \"php: command not found\" error\n\n- Try opening a new terminal window (required for PATH updates)\n- Make sure you've run `php-use.bat` at least once\n- To manually add to PATH: `set PATH=%PATH%;C:\\php-use\\bin`\n\n### Not working in Git Bash\n\n- Make sure the `php` file is executable: `chmod +x bin/php`\n- Open a new Git Bash window\n\n### Composer can't find PHP\n\n- Before running `composer`, verify PHP is working with `php --version`\n- Open a new terminal window\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## Contributing\n\nPull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.\n\n## Acknowledgments\n\nThis tool was developed to make working with multiple PHP versions on Windows easier.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faytacmalkoc%2Fphp-use","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faytacmalkoc%2Fphp-use","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faytacmalkoc%2Fphp-use/lists"}