---
title: "RunPhpCommand"
method: POST
path: "/v1/runtime/php/run/"
tags: ["runtime"]
---

# RunPhpCommand

`POST /v1/runtime/php/run/`

Run a php command as the webserver user for a given hostname. <br />CAUTION: This endpoint allows for arbitrary code execution (ACE) and is therefore disabled by default. <br />To enable this endpoint, set the "ENABLE_API_RUNTIME_PHP_RUN_CMD" environment variable to "true" when starting the API/container.<br />Only super admin accounts can use this endpoint.

## Request body

- DtoRunPhpCommandRequest
  - `command` string
  - `hostname` string
  - `timeoutSecs` integer

## Response `200`

OK

- DtoRunPhpCommandResponse
  - `exitCode` integer
  - `stdErr` string
  - `stdOut` string

## Changes

- **2025-06-02** `b07ae89cb2c9` — 1 info
  - endpoint added
- **2024-12-04** `d7ced1b11534` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/goinfinite/apis/osapi/changes/v1/runtime/php/run/post.md)

---

[API](https://skmtc.dev/goinfinite/apis/osapi.md) · [All operations](https://skmtc.dev/goinfinite/apis/osapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/goinfinite/osapi/revisions/7320a5d8ef9e/schema)
