Path: API › 网站管理

`POST /site`

切换指定网站的 PHP 版本。

## Request body

_Required._

- `action265.request_time` (string, required) — Unix 时间戳。
- `action265.request_token` (string, required) — 按 API 概览生成的签名。
- `action265.action` (string, required) — 具体操作名称。
  - one of `"SetPHPVersion"`
- `action265.siteName` (string, required) — 网站域名
- `action265.version` (string, required) — PHP 版本号，`"00"` 纯静态，`"74"`/`"80"`/`"81"`/`"82"`/`"83"`/`"84"` 等

## Example request

```text
{
  "request_time": "string",
  "request_token": "string",
  "action": "SetPHPVersion",
  "siteName": "string",
  "version": "string"
}
```

## Code samples

### cURL（填写面板地址与签名）

```curl
curl --request POST \
  --url "https://your-panel.example.com:8888/site" \
  --header "Content-Type: application/x-www-form-urlencoded" \
  --data-urlencode "request_time=<Unix时间戳>" \
  --data-urlencode "request_token=<按 API 概览生成的签名>" \
  --data-urlencode "action=SetPHPVersion" \
  --data-urlencode "siteName=<siteName>" \
  --data-urlencode "version=<version>"
```

## Responses

### default

接口响应，业务状态见下方详细说明。

#### Example

```json
{
  "status": true,
  "msg": "成功切换网站[testapi.bt.local]的PHP版本为PHP-00"
}
```

- `action265.response.default.status` (boolean, optional) — `true` 切换成功


## SetPHPVersion

切换指定网站的 PHP 版本。

- **路由**：`POST /site`
- **action**：`SetPHPVersion`

## 输入参数

| 参数名称 | 必选 | 类型 | 描述 |
|----------|------|------|------|
| action | 是 | String | 固定值 `SetPHPVersion` |
| siteName | 是 | String | 网站域名 |
| version | 是 | String | PHP 版本号，`"00"` 纯静态，`"74"`/`"80"`/`"81"`/`"82"`/`"83"`/`"84"` 等 |

## 输出参数

| 参数名称 | 类型 | 描述 |
|----------|------|------|
| status | Boolean | `true` 切换成功 |

## 示例

### 请求

```
POST /site HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded

action=SetPHPVersion&siteName=testapi.bt.local&version=00
```

### 响应

```json
{"status": true, "msg": "成功切换网站[testapi.bt.local]的PHP版本为PHP-00"}
```

