/php/extensions/{name}
0.2.0Unchanged since publicationQueue a job to turn a PHP extension on or off
settingsallSet on to true to install the extension package or false to remove it. Supply a nonempty array of installed PHP versions in versions, or use "all" to select every installed version where the extension can be changed to the requested state.
Returns 400 for an unknown extension or an invalid versions value. An explicit selection also returns 400 for an unknown or uninstalled PHP version, an extension supplied by PHP itself, or an attempt to turn on an extension that has no package for that version. Returns 409 if an explicitly selected version is already in the requested state, if "all" selects no eligible versions, or if a queued or running job for the same extension covers any selected version.
UrbeStack previews the package changes for every selected version before queuing a job. It refuses removals that would also remove a base package or another enabled extension. Each entry in refused gives the PHP version, the error, the proposed package changes in transaction, and blocked_by when available. If the preview refuses every version, the operation returns 409 with the refusals. Otherwise, it returns 202 with the php-ext job, the extension name, the requested state, the accepted versions, any refusals, and the additional extensions the package manager plans to install.
The job processes versions one at a time. After each package change, it reloads that version's PHP-FPM service, lets in-flight requests finish, and verifies the modules with php -m. The first failed or refused package change stops the job and marks the remaining versions as skipped. UrbeStack runs one PHP installation or extension change at a time.
As commands
Run as root on the serverParameters
namepath ·string, matching ^[a-z][a-z0-9_]{0,31}$RequiredRequest body
JSON· 2 fieldsonbooleanRequiredversionsvalueRequiredExample
See the API overview for how to set $API and $TOKEN.curl -sS -X POST "$API/php/extensions/alice" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"on": true,
"versions": "text"
}'202 Accepted{
"brings": {},
"job": {
"created_at": "2026-09-09T10:15:00Z",
"created_by": 1,
"created_by_name": "text",
"dismissed_at": "text",
"finished_at": "2026-09-09T10:15:04Z",
"id": 1,
"lane": "short",
"log": "",
"params": {},
"progress": 100,
"result": {},
"started_at": "2026-09-09T10:15:01Z",
"status": "queued",
"type": "rebuild",
"usual_seconds": 1
},
"name": "alice",
"on": true,
"refused": [
{
"blocked_by": [
"text"
],
"error": "Domain 'example.com' already exists",
"transaction": "text",
"version": "0.0.1"
}
],
"versions": [
"text"
]
}Errors
30 errors, each a status and a sentence400--q is a text of up to 64 characters400<name> is PHP itself in PHP <v> on this server: nothing to turn 400<name> is PHP itself in PHP <version> on this server (400<name> is not an extension this server's distribution packages for PHP400<name> is not packaged for PHP <v> on this server's repositories400A new job is queued or running400Invalid <what>: 400Invalid <what>: expected a non-negative integer400Invalid PHP version, expected e.g. 8.2400Invalid extension name '400Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter400Job parameters must be an object400Name at least one version400Name the versions (--version, repeatable) or say --all-versions400No extension named '<n>' in the catalog; urbestack-php-ext-list prints it400No extension named '<name>' in this server's catalog400PHP <_> is not installed on this server400PHP <v> is not installed on this server400Say --on or --off400Unknown PHP version '400Unknown PHP version '<v>'400Unknown PHP version '<version>'400Unknown job type400Username '<value>' is reserved400versions is a list of installed versions, or "all"401Authentication required404User '<user>' not found409<name> is 409<name> is already being turned 409Another PHP installation is already runningurbestack.com/docs/api/post-php-extensions-name/