# How to run PHP code in a sandbox Install php-cli in a Linux microVM, write the script there, and run it with `php` under a time limit and with the network off. **On Runtime, PHP is one apt command away and every script gets its own kernel.** Each sandbox is a Firecracker microVM running Ubuntu 24.04.5, where `sudo apt-get install -y php-cli` installs PHP 8.3 from Ubuntu's archive. A new sandbox took 351 ms from the create request to its first Python result at the median, measured on 24 September 2026 ([speed](/docs/speed)); bake PHP into an image and that is all the wait there is. ## PHP packages on Ubuntu 24.04 PHP is not in the default image. These are the Ubuntu 24.04 (noble) packages, read on packages.ubuntu.com on 25 September 2026: | Package | Version | What it adds | | ---------------- | ------------------------ | -------------------------------- | | `php-cli` | 8.3 (`php8.3-cli` 8.3.6) | The `php` command | | `php8.3-sqlite3` | 8.3.6 | PDO and SQLite3 for SQLite | | `php8.3-pgsql` | 8.3.6 | PDO and pgsql for PostgreSQL | | `composer` | 2.7.1 | Composer, the dependency manager | For another PHP version, start a [custom image](/docs/images) from the official `php` image on Docker Hub, such as `php:8.4-cli` (a tag listed there on 25 September 2026). ## Run a script Install once, turn the internet off, then run what you were given. The script goes in as a file and runs with an array, so nothing passes through a shell. ```ts check import { Sandbox } from "withruntime"; const script = `