Get your free beta license ↗
API operation · php group
POST

/php/extensions/{name}

First published 14 Oct 20260.2.0Unchanged since publication

Queue a job to turn a PHP extension on or off

Who may call it
AdministratorResellerCustomer
Token scope, any of
settingsall
Answers202 Accepted

Set 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 server

Parameters

namepath ·string, matching ^[a-z][a-z0-9_]{0,31}$Required

Request body

JSON· 2 fields
onbooleanRequired
versionsvalueRequired
Array of installed PHP versions to change, or "all" for every installed version where the extension can be changed to the requested state.

Example

See the API overview for how to set $API and $TOKEN.
Request
curl -sS -X POST "$API/php/extensions/alice" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "on": true,
    "versions": "text"
  }'
Response · 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 sentence
400--q is a text of up to 64 characters
400<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 PHP
400<name> is not packaged for PHP <v> on this server's repositories
400A new job is queued or running
400Invalid <what>:
400Invalid <what>: expected a non-negative integer
400Invalid PHP version, expected e.g. 8.2
400Invalid extension name '
400Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter
400Job parameters must be an object
400Name at least one version
400Name the versions (--version, repeatable) or say --all-versions
400No extension named '<n>' in the catalog; urbestack-php-ext-list prints it
400No extension named '<name>' in this server's catalog
400PHP <_> is not installed on this server
400PHP <v> is not installed on this server
400Say --on or --off
400Unknown PHP version '
400Unknown PHP version '<v>'
400Unknown PHP version '<version>'
400Unknown job type
400Username '<value>' is reserved
400versions is a list of installed versions, or "all"
401Authentication required
404User '<user>' not found
409<name> is
409<name> is already being turned
409Another PHP installation is already running
Generated from release 0.2.35 (current) · the API’s own descriptionThis entry has been unchanged since it was first published in release 0.2.0 on 14 Oct 2026.
urbestack.com/docs/api/post-php-extensions-name/