Installation
What Are the Requirements?
- PHP 8.0 or higher
- Composer
- ext-json PHP extension
- ext-curl PHP extension
- ext-pcntl PHP extension (Required for Unix-like systems, not available on Windows)
⚠️ Note:
pcntlis not available on Windows as it only works in CLI environments on Unix-based systems.- If you're using Windows, see the Running on Windows section below.
How Do I Install the VoltTest SDK?
There are two ways to install the VoltTest SDK:
- Install the SDK inside your project using Composer.
- Clone the SDK repository.
Install the SDK using Composer
Run the following command inside your project directory:
composer require volt-test/php-sdk
That's it! You have successfully installed the VoltTest SDK in your project.
See the Getting Started guide to create your first test script.
Clone the SDK Repository
If you prefer to clone the repository and install dependencies manually:
- Clone the Repository:
git clone git@github.com:volt-test/php-sdk.git
- Navigate to the project directory:
cd php-sdk
- Install dependencies:
composer install
Now, let's get started by creating a simple test script.
How Do I Run VoltTest on Windows?
Since pcntl is not supported on Windows, you need to run VoltTest in a Linux environment. Here are your options:
Option 1: Use Windows Subsystem for Linux (WSL) (Recommended)
- Install WSL by running this command in PowerShell (Admin):
wsl --install
- Restart your PC and open Ubuntu from the Start Menu.
- Install PHP inside WSL:
sudo apt updatesudo apt install php-cli php-curl php-json
- Run VoltTest commands inside WSL:
php your-script.php
Option 2: Use Docker
Run VoltTest inside a Docker container:
docker run --rm -v $(pwd):/app -w /app php:8-cli php your-script.php
For Alpine-based PHP:
docker run --rm -v $(pwd):/app -w /app php:8-alpine sh -c "apk add php-cli php-curl php-json && php your-script.php"
Option 3: Use a Linux Virtual Machine
- Install VirtualBox or VMware.
- Set up an Ubuntu-based VM.
- Install PHP and required extensions.
- Run your VoltTest scripts inside the VM.