Requirements
Before installing PsySH, ensure your system meets these requirements:- PHP 7.4 or higher (PHP 8.0+ recommended)
- Required extensions:
ext-json(usually enabled by default)ext-tokenizer(usually enabled by default)
PsySH works with PHP 7.4 through PHP 8.x. If you’re using an older version, you’ll need to upgrade PHP first.
Optional Extensions
For the best experience, consider installing these optional extensions:Installation Methods
Method 1: Composer (Recommended)
The easiest way to install PsySH is via Composer.When installed as a project dependency, PsySH automatically detects and uses your project’s autoloader, giving you access to all your classes.
Method 2: Download PHAR
For a standalone installation, download the pre-compiled PHAR file.Move to System Path (Optional)
For global access, move the PHAR to your system path:Or to a user-local bin directory:
Method 3: Manual Installation
For development or contributing to PsySH:Updating PsySH
Update Composer Installation
Update PHAR Installation
If you installed PsySH via PHAR, you can use the built-in self-update command:The
--self-update option is only available when running PsySH from a PHAR file.PHP Manual Installation
For the best experience, download the PHP manual for offline documentation access:Verifying Your Installation
Once installed, verify everything is working correctly:View Environment Info
- PHP version and extensions
- Configuration file locations
- History settings
- Manual database status
- Available features
Command-Line Options
PsySH supports various command-line options:Common Options
| Option | Description |
|---|---|
-h, --help | Display help message |
-V, --version | Display PsySH version |
--info | Show environment and configuration info |
-c, --config=FILE | Use alternate config file |
--cwd=PATH | Use alternate working directory |
--color / --no-color | Force or disable colors |
-i, --interactive | Force interactive mode |
-n, --no-interactive | Run without interactive input |
--warm-autoload | Enable autoload warming for better tab completion |
Loading Files
You can load PHP files before starting the shell:- Loading application bootstrappers
- Setting up test environments
- Importing utility functions
Project Trust
When PsySH detects a local version in your project, it may prompt you about trust:Next Steps
Quick Start
Learn the basics and start using PsySH
Configuration
Customize PsySH with your preferred settings