Installation
Get phpkg Up and Running
Install phpkg and start managing PHP packages the lightweight way—no Composer bloat, just direct Git power. It sets up in your home directory, making it accessible from any project with a single command.
Requirements
Ensure your system has:
- PHP >= 8.1: With
php-mbstring(for string handling),php-zip(for unpacking archives), andphp-curl(for Git downloads). - Git: To clone repositories directly.
- unzip: To extract package files.
Works on Unix/Linux/macOS and Windows. Windows users need PHP 8.5 or later (PHP 8.5 is fully tested; later versions may need additional testing).
Install in One Step
Unix/Linux/macOS
Run this command to install phpkg:
bash -c "$(curl -fsSL https://raw.githubusercontent.com/php-repos/phpkg-installation/master/install.sh)"
- What It Does: Downloads
phpkgto~/.phpkg, adds it to your$PATH(via.bashrcor.zshrc), and preps it for use. - Next: Open a new terminal to access phpkg commands—or source your current shell manually:
source ~/.bashrc # or ~/.zshrc, depending on your shellTrouble? Verify
$PATHincludes~/.phpkg/binwithecho $PATH.
Windows
Run this command in PowerShell to install phpkg:
powershell -ExecutionPolicy Bypass -Command "Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/php-repos/phpkg-installation/master/install.ps1' -OutFile install.ps1 -UseBasicParsing; powershell -ExecutionPolicy Bypass -File install.ps1"
- What It Does: Downloads
phpkgto%USERPROFILE%\.phpkg, adds it to yourPATH, and preps it for use. - Next: Open a new terminal to access phpkg commands. The PATH is updated automatically.
Verify It Works
Test your install:
phpkg version
You should see the phpkg version number. Ready? Jump to Getting Started to add packages or run scripts!
Verbose Mode
You can enable verbose logging using -v, -vv, or -vvv flags before the main command:
phpkg -v add package
phpkg -vv add package
phpkg -vvv add package
- Important: Verbose flags must come before the command.
phpkg add -vv packagewill not work—anything after the command goes to the command itself. - Levels:
-vshows basic verbose output,-vvshows more details,-vvvshows maximum verbosity including debug information.
Related Documentation
- Getting Started - Your first project with phpkg
- Version Command - Check your phpkg version
- Concepts - Understand how phpkg works
- Troubleshooting - Solve installation issues
- FAQ - Frequently asked questions