{"id":34651373,"url":"https://github.com/php-repos/phpkg-installation","last_synced_at":"2026-05-27T11:09:43.890Z","repository":{"id":143521431,"uuid":"589161649","full_name":"php-repos/phpkg-installation","owner":"php-repos","description":"Installation script for phpkg","archived":false,"fork":false,"pushed_at":"2025-12-25T15:00:29.000Z","size":78,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-05-27T11:06:39.218Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/php-repos.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":"SECURITY.md","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":"2023-01-15T09:21:21.000Z","updated_at":"2025-12-25T15:00:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"6f956788-0e72-4e2e-a66e-1ab333351ef7","html_url":"https://github.com/php-repos/phpkg-installation","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/php-repos/phpkg-installation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-repos%2Fphpkg-installation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-repos%2Fphpkg-installation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-repos%2Fphpkg-installation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-repos%2Fphpkg-installation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/php-repos","download_url":"https://codeload.github.com/php-repos/phpkg-installation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-repos%2Fphpkg-installation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33562918,"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-05-27T02:00:06.184Z","response_time":53,"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":"2025-12-24T17:56:36.075Z","updated_at":"2026-05-27T11:09:43.885Z","avatar_url":"https://github.com/php-repos.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# phpkg Installation README\n\nWelcome to the phpkg installation guide! This repository provides a convenient script for installing [phpkg](https://phpkg.com), a package manager for PHP projects.\n\n## Introduction\n\nFollowing these instructions, you can install, update and remove phpkg.\n\n## Prerequisites\n\nThere are no prerequisites if you have Arch, Fedora, Mac, Ubuntu, or are using Docker with Alpine Linux as the installation will install requirements automatically.\n\n**For Windows users:** PHP and required extensions must be installed manually before running the installation script.\n\nBefore you begin, ensure that the following prerequisites are met:\n\n1. **PHP 8.2 or higher**: PHP must be installed on your system. To check your PHP version, run `php --version`. You should see \"PHP 8.2\" or a higher version.\n2. **Required PHP extensions**: The following PHP extensions must be enabled:\n   - `mbstring` (required)\n   - `curl` (required)\n   - `zip` (required)\n   \n   You can check if extensions are loaded by running `php -m`. On Linux/macOS, the installation script will attempt to install these extensions automatically. On Windows, you must enable them manually in `php.ini`.\n3. **Unzip**: The `unzip` utility should be installed on your operating system. You can check if `unzip` is installed \nby running `unzip --version`. If it's not installed, you can typically install it using your system's package manager\n(e.g., `apt`, `yum`, `pacman`, or `brew`). On Windows, PowerShell's `Expand-Archive` is used, so no additional tool is needed.\n\n## Install\n\n### Linux and macOS\n\nTo install `phpkg` on Linux or macOS, you can run the following command in your terminal:\n\n```shell\nbash -c \"$(curl -fsSL https://raw.githubusercontent.com/php-repos/phpkg-installation/master/install.sh)\"\n```\n\n### Windows\n\n**Important:** Before installing phpkg on Windows, you must install PHP and enable required extensions manually.\n\n#### Step 1: Install PHP\n\n1. Download PHP from [windows.php.net](https://windows.php.net/download/)\n2. Extract the ZIP file to a directory (e.g., `C:\\php`)\n3. Add the PHP directory to your PATH environment variable:\n   - Open System Properties \u003e Environment Variables\n   - Edit the User or System PATH variable\n   - Add the PHP directory (e.g., `C:\\php`)\n4. Verify installation: Open a new PowerShell window and run `php --version`\n\n#### Step 2: Configure PHP Extensions\n\n1. Find your `php.ini` file by running: `php --ini`\n2. Copy `php.ini-development` to `php.ini` in the PHP directory (if `php.ini` doesn't exist)\n3. Open `php.ini` in a text editor and:\n   - Set `extension_dir = \"ext\"` (or the full path to your ext directory)\n   - Uncomment or add the following lines:\n     ```\n     extension=php_mbstring.dll\n     extension=php_curl.dll\n     extension=php_zip.dll\n     ```\n4. Save the file and restart your terminal\n5. Verify extensions are loaded: `php -m | findstr -i \"mbstring curl zip\"`\n\n#### Step 3: Install phpkg\n\nOnce PHP and extensions are configured, open PowerShell and run:\n\n```powershell\npowershell -ExecutionPolicy Bypass -Command \"Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/php-repos/phpkg-installation/master/install.ps1' -OutFile install.ps1; .\\install.ps1\"\n```\n\nOr if you prefer to download and run it manually:\n\n```powershell\n# Download the script\nInvoke-WebRequest -Uri 'https://raw.githubusercontent.com/php-repos/phpkg-installation/master/install.ps1' -OutFile install.ps1\n\n# Run the script (bypasses execution policy for this session)\npowershell -ExecutionPolicy Bypass -File .\\install.ps1\n```\n\n**Troubleshooting Windows Execution Policy:**\n\nIf you encounter an error like \"cannot be loaded because running scripts is disabled on this system\", you have two options:\n\n1. **Bypass for this script only (recommended):**\n   ```powershell\n   powershell -ExecutionPolicy Bypass -File .\\install.ps1\n   ```\n\n2. **Change execution policy for current user (permanent):**\n   ```powershell\n   Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser\n   ```\n   Then run: `.\\install.ps1`\n\n**Note for Windows users:**\n- The installation script will check if PHP and required extensions are available\n- If PHP or extensions are missing, the script will display instructions and exit\n- You must install and configure PHP manually before running the installation script\n\n### What Happens During Installation\n\nHere's what happens when you run the installation command:\n\n1. The command downloads the installation script from the `php-repos/phpkg-installation` repository.\n2. **On Linux/macOS:** The script checks for prerequisites and installs PHP and required extensions if they don't exist.\n3. **On Windows:** The script checks if PHP and required extensions are available. If not, it displays instructions and exits.\n4. The installation script performs the following actions:\n   - Detects if this is a fresh installation or an update\n   - Downloads the latest release of `phpkg`\n   - If updating, preserves your existing `credentials.json` file (so you don't lose your configuration)\n   - Extracts the downloaded zip file and puts it under your home directory and renames it to `.phpkg` (Linux/macOS) or `.phpkg` in your user profile (Windows)\n   - Creates a `credentials.json` file from the example if it doesn't exist (on fresh installations)\n   - On Windows, creates a `phpkg.bat` wrapper file to make the command work properly\n   - Updates your shell configuration (.bashrc or .zshrc on Unix-like systems) or Windows PATH environment variable to include the `phpkg` command in your PATH.\n       \nAfter the installation is complete, you might need to open a new terminal to use `phpkg`.\n\n**Note:** You can safely re-run the installation script at any time to update phpkg to the latest version. Your credentials will be preserved during updates. \n\n### Verify\n\nTo verify the installation, run the following command and you should see the installed version:\n\n```shell\nphpkg --version\n```\n\n## Update\n\nTo update `phpkg` to the latest version, simply **rerun the installation script**. The script will automatically:\n\n- Detect the existing installation\n- Preserve your `credentials.json` file (so you don't lose your configuration)\n- Remove the old installation\n- Install the latest version\n- Update your PATH if needed\n\n**Linux/macOS:**\n```shell\nbash -c \"$(curl -fsSL https://raw.githubusercontent.com/php-repos/phpkg-installation/master/install.sh)\"\n```\n\n**Windows:**\n```powershell\npowershell -ExecutionPolicy Bypass -Command \"Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/php-repos/phpkg-installation/master/install.ps1' -OutFile install.ps1; .\\install.ps1\"\n```\n\n**Verify the Update:**\nAfter the update completes, open a new terminal and run:\n```shell\nphpkg --version\n```\nYou should see the latest phpkg version displayed in your terminal.\n\n**Note:** You can also manually remove the installation first if you prefer, but it's not necessary as the script handles it automatically.\n\n## Uninstall\n\nTo uninstall `phpkg`, you can run the following command:\n\n**Linux/macOS:**\n```shell\nrm -fR ~/.phpkg\n```\n\n**Windows (PowerShell):**\n```powershell\nRemove-Item -Recurse -Force $env:USERPROFILE\\.phpkg\n```\n\nThis command will remove the phpkg directory from your system.\n\n**Note for Windows users:** You may also want to remove phpkg from your PATH environment variable manually through System Properties \u003e Environment Variables if it was added there.\n\nThank you for using `phpkg`! We hope it enhances your PHP development experience.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphp-repos%2Fphpkg-installation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphp-repos%2Fphpkg-installation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphp-repos%2Fphpkg-installation/lists"}