Installation
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:
pcntl
is 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.
Installation Steps
There are two ways to install the Volt-Test 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 Volt-Test 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.
Running on Windows
Since pcntl
is not supported on Windows, you need to run Volt-Test 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 update
sudo apt install php-cli php-curl php-json - Run Volt-Test commands inside WSL:
php your-script.php
Option 2: Use Docker
Run Volt-Test 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 Volt-Test scripts inside the VM.