身份验证
请将 API 密钥作为 bearer 令牌发送。该密钥必须具有 hosting.php.manage 权限;缺少该权限的密钥将被拒绝并返回 403 状态码,而非 404。
此端点不需要组织 ID。您的密钥已用于识别其所属的组织,且响应范围也仅限于该组织。
免费试用
将尖括号中的内容替换为您自己的值,并将键占位符替换为您仪表板中的一个键。
curl -X PUT https://api.zinndigital.com/v1/sites/{siteId}/php-version \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "version": <string> }'已登录?您仪表板中的 API 控制台会自动填入您真实的组织 ID 和您自己的密钥,并针对实时 API 运行请求,以便您查看实际的响应。 在 API 控制台中打开此端点
详细信息
Sets the site's desired PHP version and returns `202 Accepted`. The target must be a version currently offered for the site's product line (or the site's own current version); anything else is a `422`. A retired version an existing site already runs is kept — this call never forces a migration. Requires `hosting.php.manage`. **The machine serving the site is told before the row is written**, on both lines: one ack-checked vendor call on the resold range, and one idempotent `cloudlinux-selector set --current-version=` on our own fleet. A version the machine refuses is a `422` and the row is left alone, so the platform never claims a runtime the box is not running. `202` therefore under-promises rather than over-promises. A site with no hosting vendor and no placed worker has nothing serving it yet: the desired version is recorded and provisioning applies it. A machine that cannot be **reached at all** — its account does not exist yet, SSH is down, the vendor is unavailable — is a `503`, not a `422` and not a `500`: the request was valid and a retry can succeed. The stored version is left exactly as it was, so a `503` here means nothing changed anywhere.
参数
| 名称 | 类型 | 必填 | 内容简介 |
|---|---|---|---|
siteId (path) | Uuid | 是 | Site ID (UUIDv7). |
请求正文
| 名称 | 类型 | 必填 | 内容简介 |
|---|---|---|---|
version | string | 是 | A version offered for the site's product line (or the site's current one). |
响应
| 名称 | 类型 | 必填 | 内容简介 |
|---|---|---|---|
version | string | 是 | The site's effective PHP version (its own, or its line's default). |
available | string[] | 是 | Versions the site may switch to — those offered for its product line, plus its own current version even if that has since been retired (grandfathered). |
applied | boolean | 否 | Whether the machine serving this site was actually told, and the change read back off it. Present on the `PUT` response only. `false` is not a failure: it means the site has no… |
此端点可能返回的错误
401 · 403 · 404 · 422 · 429 · 503