> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sandywp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get PHP ini configuration

> Returns the sandbox's current PHP ini values, defaults, memory-limit ceiling, PHP version, and any pending change.



## OpenAPI

````yaml /openapi.yaml get /api/app/sites/{id}/php-config
openapi: 3.1.0
info:
  title: SandyWP API
  version: 0.1.0
  summary: Complete supported customer API for SandyWP automation.
  description: >
    This is the complete supported customer API for automating SandyWP
    sandboxes, reusable

    Templates and Blueprints, Imports, Workspaces, account credentials, and
    OAuth connection setup.

    It is the stable HTTP contract for developer integrations; browser,
    provider, and operations

    routes on the same host are deliberately not part of this document.


    **Exclusions ledger.** The specification excludes guest/launcher creation
    (`POST /api/sites`),

    account profile/avatar/password/support and GitHub UI handlers, billing
    checkout/portal/sync,

    public launch routes, plugin/theme search proxies, storage, activity
    telemetry, newsletter,

    health, metrics, impersonation, Slack/GitHub callbacks, Git/Polar webhooks,
    all `/api/admin/**`,

    and all `/api/internal/**` worker or SSH-control routes. Those endpoints are
    browser backends,

    provider callbacks, or operational control-plane interfaces rather than
    supported developer APIs.


    ## Conventions


    - Requests and responses are JSON. Send `Content-Type: application/json` on
    writes (the file
      upload and plugin-ZIP-upload endpoints instead use `multipart/form-data`, as noted on those
      operations).
    - Sandboxes and Templates are addressed by their opaque `id` in the API (for
    example
      `site_abc123`, `tpl_xyz789`).
    - Errors use a consistent envelope — see the `Error` schema. Some actions
    require a paid plan
      and fail with HTTP `402` and a specific error code (for example
      `template_sharing_requires_paid_plan`); each is called out on the operation that returns it.
    - **Async by default.** Provisioning and other slow sandbox mutations happen
    on a worker, not
      inline in the HTTP request. An endpoint that starts one either returns a `jobId` to poll (see
      the `Job` / `JobSummary` schemas and each operation's description), returns the resource in a
      non-terminal state (a site `"creating"`, a Template `"building"`) to re-fetch until it settles,
      or both.
    - A personal bearer token can call the authenticated operations below. A
    scoped OAuth token is
      accepted only by `GET /api/account/me` and the Imports family; it needs `import:read` or
      `import:write` for the matching import operation. Other REST operations treat scoped tokens
      as unauthenticated.
  contact:
    name: SandyWP
    url: https://app.sandywp.com/docs/api
servers:
  - url: https://app.sandywp.com
security:
  - bearerAuth: []
tags:
  - name: Templates
    description: >-
      A Template is a snapshot of a finished sandbox — WordPress/PHP versions,
      plugins, themes, content, and database — ready to restore in seconds.
      Templates come from saving a ready sandbox, and can optionally be
      published as a public "launch this demo" link.
  - name: Sites
    description: >-
      A Site is a disposable WordPress sandbox: its lifecycle
      (create/restore/reset/delete) and the per-sandbox tools built on top of it
      (PHP runtime & ini config, WordPress debug settings, database access,
      outgoing-email capture, plugin deploys, the file manager, Git deployment,
      and SSH access).
  - name: Blueprints
    description: >-
      Reviewable WordPress build recipes that can be validated, saved, run on a
      sandbox, or baked into a Template.
  - name: Imports
    description: >-
      Archive-upload workflows for cloning a live WordPress site or pushing a
      local installation. Scoped OAuth tokens may use only this family, with
      `import:read` for reads and `import:write` for mutations.
  - name: Workspaces
    description: Workspace selection plus member and custom-role administration.
  - name: Account
    description: Identity, usage, personal API tokens, and account SSH public keys.
  - name: OAuth
    description: >-
      Public-client registration and PKCE authorization-code token exchange for
      supported connectors.
paths:
  /api/app/sites/{id}/php-config:
    get:
      tags:
        - Sites
      summary: Get PHP ini configuration
      description: >-
        Returns the sandbox's current PHP ini values, defaults, memory-limit
        ceiling, PHP version, and any pending change.
      operationId: getSitePhpConfig
      parameters:
        - $ref: '#/components/parameters/SiteIdParam'
        - $ref: '#/components/parameters/WorkspaceHeaderParam'
      responses:
        '200':
          description: The sandbox's PHP configuration status.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SitePhpConfigStatus'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/SiteNotFound'
components:
  parameters:
    SiteIdParam:
      name: id
      in: path
      required: true
      description: The sandbox id.
      schema:
        type: string
      example: site_abc123
    WorkspaceHeaderParam:
      name: X-SandyWP-Workspace
      in: header
      required: false
      description: >-
        Selects which of the caller's workspaces to act in, for accounts
        belonging to more than one (legacy alias: `X-SandyWP-Organization`).
        Defaults to the caller's own personal workspace when omitted. Every id
        in this API (sandboxes, Templates, repositories) is scoped to a single
        workspace, so this header changes which set of resources is visible.
      schema:
        type: string
  schemas:
    SitePhpConfigStatus:
      type: object
      description: The response of `GET /api/app/sites/{id}/php-config`.
      required:
        - phpConfig
        - defaults
        - limits
        - pending
        - lastJob
        - phpVersion
        - phpVersionOptions
        - versionSwitch
      properties:
        phpConfig:
          $ref: '#/components/schemas/SitePhpConfig'
        defaults:
          $ref: '#/components/schemas/SitePhpConfig'
        limits:
          type: object
          required:
            - memoryLimitMaxMb
          properties:
            memoryLimitMaxMb:
              type: integer
              description: >-
                This sandbox's effective `memoryLimitMb` ceiling, derived from
                its container memory limit.
        pending:
          type: boolean
          description: >-
            True while an `apply_php_config` job is queued/running for this
            sandbox.
        lastJob:
          $ref: '#/components/schemas/JobRefSummary'
        phpVersion:
          type: string
          description: The sandbox's current PHP runtime version.
        phpVersionOptions:
          type: array
          description: >-
            The PHP versions this server supports switching to. As of this
            writing that is exactly `["8.3", "8.2", "8.1"]` — the hand-written
            API guide's example response shows an additional `"8.4"` that the
            deployed `PHP_VERSION_OPTIONS` list does not offer; treat this
            field's live value, not that example, as authoritative.
          items:
            type: string
        versionSwitch:
          type: object
          required:
            - pending
            - lastJob
          properties:
            pending:
              type: boolean
              description: >-
                True while a `switch_php_version` job is queued/running for this
                sandbox.
            lastJob:
              type:
                - object
                - 'null'
              required:
                - id
                - status
                - lastError
                - phpVersion
              properties:
                id:
                  type: string
                status:
                  $ref: '#/components/schemas/JobStatus'
                lastError:
                  type:
                    - string
                    - 'null'
                phpVersion:
                  type:
                    - string
                    - 'null'
                  description: The version that switch job targeted.
    SitePhpConfig:
      type: object
      description: >-
        A sandbox's PHP ini overrides. All fields are required both when read
        back from `GET .../php-config` and when written via `PUT .../php-config`
        (the PUT endpoint replaces the whole object — see that operation's
        description for why this differs from what the hand-written API guide
        says).
      required:
        - maxExecutionTime
        - maxInputTime
        - maxInputVars
        - memoryLimitMb
        - allowUrlFopen
        - postMaxSizeMb
        - uploadMaxFilesizeMb
        - sessionGcMaxlifetime
        - outputBufferingBytes
      properties:
        maxExecutionTime:
          type: integer
          minimum: 10
          maximum: 300
          description: Seconds. `max_execution_time`.
        maxInputTime:
          type: integer
          minimum: 10
          maximum: 300
          description: Seconds. `max_input_time`.
        maxInputVars:
          type: integer
          minimum: 100
          maximum: 10000
          description: '`max_input_vars`.'
        memoryLimitMb:
          type: integer
          minimum: 64
          maximum: 512
          description: >-
            MB. `memory_limit`. The static maximum is 512, but the effective
            ceiling for a given sandbox is usually lower — see
            `limits.memoryLimitMaxMb` on the `GET` response.
        allowUrlFopen:
          type: boolean
          description: '`allow_url_fopen`.'
        postMaxSizeMb:
          type: integer
          minimum: 8
          maximum: 5120
          description: MB. `post_max_size`.
        uploadMaxFilesizeMb:
          type: integer
          minimum: 2
          maximum: 5120
          description: MB. `upload_max_filesize`. Must not exceed `postMaxSizeMb`.
        sessionGcMaxlifetime:
          type: integer
          minimum: 300
          maximum: 86400
          description: Seconds. `session.gc_maxlifetime`.
        outputBufferingBytes:
          type: integer
          minimum: 0
          maximum: 65536
          description: Bytes (0 disables). `output_buffering`.
    JobRefSummary:
      type:
        - object
        - 'null'
      description: >-
        A minimal pointer to the most recent job of a given kind, or `null` if
        none has ever run.
      required:
        - id
        - status
        - lastError
      properties:
        id:
          type: string
        status:
          $ref: '#/components/schemas/JobStatus'
        lastError:
          type:
            - string
            - 'null'
    JobStatus:
      type: string
      enum:
        - pending
        - claimed
        - running
        - succeeded
        - failed
        - retryable
    Error:
      type: object
      description: >-
        The standard error envelope returned by every endpoint on a non-2xx
        response.
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: >-
                A stable, machine-readable error code (e.g. `invalid_request`,
                `site_not_found`, `plan_limit_reached`). See each operation for
                the codes it can return.
              example: invalid_request
            message:
              type: string
              description: A human-readable message. Safe to display to an end user.
            details:
              type: object
              description: >-
                Optional structured context (e.g. `{"plan": "free", "limit": 2}`
                for a plan-limit error). Omitted entirely on the generic
                internal-error fallback; `{}` when an error has no extra
                context.
              additionalProperties: true
  responses:
    Unauthorized:
      description: >-
        No valid bearer token was presented, or a scoped OAuth token was used
        outside its allowed Imports and account-identity routes.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: auth_required
              message: A logged-in user is required.
              details: {}
    Forbidden:
      description: >-
        The caller's current workspace Role does not grant the capability this
        action requires.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: capability_required
              message: Your role does not allow this.
              details:
                capability: internals
    SiteNotFound:
      description: >-
        No such sandbox, or it is not visible to the caller. Ownership failures
        are intentionally indistinguishable from a missing sandbox.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: site_not_found
              message: Site not found.
              details: {}
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Personal API token, sent as `Authorization: Bearer <SANDYWP_API_KEY>`.
        Obtain one from the dashboard account menu (API keys), `sandywp auth
        login`, or `POST /api/account/tokens`. A missing or invalid token
        returns `401 auth_required`. Scoped OAuth tokens are limited to the
        Imports family and `GET /api/account/me`; see the top-level conventions.

````