# Client — PHP

<a id="delete-api-v1-client-domains-domain-php-config"></a>
#### `DELETE /api/v1/client/domains/{domain}/php/config`

*Reset domain PHP config (client)*

Reset per-domain PHP configuration to account defaults for a domain owned by the authenticated client account.

**Path parameters:**

| Name | Type | Required | Notes |
|------|------|----------|-------|
| `domain` | string | yes | — |

**Responses:**

| Status | Schema | Description |
|--------|--------|-------------|
| `200` | `ApiSuccess_dict_str__Any__` | Successful Response |
| `422` | `HTTPValidationError` | Validation Error |

**Response example (200):**

```json
{
  "data": {},
  "message": "",
  "status": "success",
  "warnings": [
    "string"
  ]
}
```

**cURL example:**

```bash
curl -X DELETE \
  -H "X-WHost-Key: $WHOST_API_KEY" \
  -H "X-WHost-Timestamp: $(date +%s)" \
  -H "X-WHost-Nonce: $(openssl rand -hex 16)" \
  -H "X-WHost-Signature: $(compute_hmac)" \
  https://your-server:2000/api/v1/client/domains/{domain}/php/config
```

---

<a id="get-api-v1-client-domains-domain-php-config"></a>
#### `GET /api/v1/client/domains/{domain}/php/config`

*Get domain PHP config (client)*

Return the per-domain PHP configuration for a domain owned by the authenticated client account.

**Path parameters:**

| Name | Type | Required | Notes |
|------|------|----------|-------|
| `domain` | string | yes | — |

**Responses:**

| Status | Schema | Description |
|--------|--------|-------------|
| `200` | `ApiSuccess_dict_str__Any__` | Successful Response |
| `422` | `HTTPValidationError` | Validation Error |

**Response example (200):**

```json
{
  "data": {},
  "message": "",
  "status": "success",
  "warnings": [
    "string"
  ]
}
```

**cURL example:**

```bash
curl -X GET \
  -H "X-WHost-Key: $WHOST_API_KEY" \
  -H "X-WHost-Timestamp: $(date +%s)" \
  -H "X-WHost-Nonce: $(openssl rand -hex 16)" \
  -H "X-WHost-Signature: $(compute_hmac)" \
  https://your-server:2000/api/v1/client/domains/{domain}/php/config
```

---

<a id="put-api-v1-client-domains-domain-php-config"></a>
#### `PUT /api/v1/client/domains/{domain}/php/config`

*Update domain PHP config (client)*

Update the per-domain PHP configuration for a domain owned by the authenticated client account.

**Path parameters:**

| Name | Type | Required | Notes |
|------|------|----------|-------|
| `domain` | string | yes | — |

**Body fields:**

| Field | Type | Required | Notes |
|-------|------|----------|-------|
| `display_errors` | boolean | no | — |
| `max_execution_time` | integer | no | — |
| `max_input_time` | integer | no | — |
| `max_input_vars` | integer | no | — |
| `memory_limit` | string | no | — |
| `post_max_size` | string | no | — |
| `upload_max_filesize` | string | no | — |

**Request body example:**

```json
{
  "display_errors": false,
  "max_execution_time": 0,
  "max_input_time": -1.0,
  "max_input_vars": 1.0,
  "memory_limit": "string",
  "post_max_size": "string",
  "upload_max_filesize": "string"
}
```

**Responses:**

| Status | Schema | Description |
|--------|--------|-------------|
| `200` | `ApiSuccess_dict_str__Any__` | Successful Response |
| `422` | `HTTPValidationError` | Validation Error |

**Response example (200):**

```json
{
  "data": {},
  "message": "",
  "status": "success",
  "warnings": [
    "string"
  ]
}
```

**cURL example:**

```bash
curl -X PUT \
  -H "X-WHost-Key: $WHOST_API_KEY" \
  -H "X-WHost-Timestamp: $(date +%s)" \
  -H "X-WHost-Nonce: $(openssl rand -hex 16)" \
  -H "X-WHost-Signature: $(compute_hmac)" \
  -H "Content-Type: application/json" \
  -d @body.json \
  https://your-server:2000/api/v1/client/domains/{domain}/php/config
```

---

<a id="put-api-v1-client-domains-domain-php-version"></a>
#### `PUT /api/v1/client/domains/{domain}/php/version`

*Change domain PHP version (client)*

Change the PHP version for a specific domain owned by the authenticated client account.

**Path parameters:**

| Name | Type | Required | Notes |
|------|------|----------|-------|
| `domain` | string | yes | — |

**Body fields:**

| Field | Type | Required | Notes |
|-------|------|----------|-------|
| `version` | string | yes | pattern=`^\d+\.\d+$` |

**Request body example:**

```json
{
  "version": "string"
}
```

**Responses:**

| Status | Schema | Description |
|--------|--------|-------------|
| `200` | `ApiSuccess_dict_str__Any__` | Successful Response |
| `422` | `HTTPValidationError` | Validation Error |

**Response example (200):**

```json
{
  "data": {},
  "message": "",
  "status": "success",
  "warnings": [
    "string"
  ]
}
```

**cURL example:**

```bash
curl -X PUT \
  -H "X-WHost-Key: $WHOST_API_KEY" \
  -H "X-WHost-Timestamp: $(date +%s)" \
  -H "X-WHost-Nonce: $(openssl rand -hex 16)" \
  -H "X-WHost-Signature: $(compute_hmac)" \
  -H "Content-Type: application/json" \
  -d @body.json \
  https://your-server:2000/api/v1/client/domains/{domain}/php/version
```

---

<a id="get-api-v1-client-php-config"></a>
#### `GET /api/v1/client/php/config`

*Get PHP config (client)*

Return the account-wide PHP configuration (php.ini directives) for the authenticated client account.

**Responses:**

| Status | Schema | Description |
|--------|--------|-------------|
| `200` | `ApiSuccess_dict_str__Any__` | Successful Response |

**Response example (200):**

```json
{
  "data": {},
  "message": "",
  "status": "success",
  "warnings": [
    "string"
  ]
}
```

**cURL example:**

```bash
curl -X GET \
  -H "X-WHost-Key: $WHOST_API_KEY" \
  -H "X-WHost-Timestamp: $(date +%s)" \
  -H "X-WHost-Nonce: $(openssl rand -hex 16)" \
  -H "X-WHost-Signature: $(compute_hmac)" \
  https://your-server:2000/api/v1/client/php/config
```

---

<a id="put-api-v1-client-php-config"></a>
#### `PUT /api/v1/client/php/config`

*Update PHP config (client)*

Update account-wide PHP configuration (memory_limit, upload_max_filesize, etc.) for the authenticated client account.

**Body fields:**

| Field | Type | Required | Notes |
|-------|------|----------|-------|
| `display_errors` | boolean | no | — |
| `error_reporting` | string | no | — |
| `max_execution_time` | integer | no | — |
| `max_input_time` | integer | no | — |
| `max_input_vars` | integer | no | — |
| `memory_limit` | string | no | — |
| `post_max_size` | string | no | — |
| `upload_max_filesize` | string | no | — |

**Request body example:**

```json
{
  "display_errors": false,
  "error_reporting": "string",
  "max_execution_time": 0,
  "max_input_time": -1.0,
  "max_input_vars": 1.0,
  "memory_limit": "string",
  "post_max_size": "string",
  "upload_max_filesize": "string"
}
```

**Responses:**

| Status | Schema | Description |
|--------|--------|-------------|
| `200` | `ApiSuccess_dict_str__Any__` | Successful Response |
| `422` | `HTTPValidationError` | Validation Error |

**Response example (200):**

```json
{
  "data": {},
  "message": "",
  "status": "success",
  "warnings": [
    "string"
  ]
}
```

**cURL example:**

```bash
curl -X PUT \
  -H "X-WHost-Key: $WHOST_API_KEY" \
  -H "X-WHost-Timestamp: $(date +%s)" \
  -H "X-WHost-Nonce: $(openssl rand -hex 16)" \
  -H "X-WHost-Signature: $(compute_hmac)" \
  -H "Content-Type: application/json" \
  -d @body.json \
  https://your-server:2000/api/v1/client/php/config
```

---

<a id="get-api-v1-client-php-domains"></a>
#### `GET /api/v1/client/php/domains`

*List domain PHP info (client)*

Return all domains and their PHP version/config for the authenticated client account.

**Responses:**

| Status | Schema | Description |
|--------|--------|-------------|
| `200` | `ApiSuccess_dict_str__Any__` | Successful Response |

**Response example (200):**

```json
{
  "data": {},
  "message": "",
  "status": "success",
  "warnings": [
    "string"
  ]
}
```

**cURL example:**

```bash
curl -X GET \
  -H "X-WHost-Key: $WHOST_API_KEY" \
  -H "X-WHost-Timestamp: $(date +%s)" \
  -H "X-WHost-Nonce: $(openssl rand -hex 16)" \
  -H "X-WHost-Signature: $(compute_hmac)" \
  https://your-server:2000/api/v1/client/php/domains
```

---

<a id="get-api-v1-client-php-extensions"></a>
#### `GET /api/v1/client/php/extensions`

*Get PHP extensions (client)*

Return the status of all PHP extensions (enabled/disabled) for the authenticated client account.

**Responses:**

| Status | Schema | Description |
|--------|--------|-------------|
| `200` | `ApiSuccess_dict_str__Any__` | Successful Response |

**Response example (200):**

```json
{
  "data": {},
  "message": "",
  "status": "success",
  "warnings": [
    "string"
  ]
}
```

**cURL example:**

```bash
curl -X GET \
  -H "X-WHost-Key: $WHOST_API_KEY" \
  -H "X-WHost-Timestamp: $(date +%s)" \
  -H "X-WHost-Nonce: $(openssl rand -hex 16)" \
  -H "X-WHost-Signature: $(compute_hmac)" \
  https://your-server:2000/api/v1/client/php/extensions
```

---

<a id="put-api-v1-client-php-extensions"></a>
#### `PUT /api/v1/client/php/extensions`

*Toggle PHP extension (client)*

Enable or disable a single PHP extension for the authenticated client account.

**Body fields:**

| Field | Type | Required | Notes |
|-------|------|----------|-------|
| `enabled` | boolean | yes | — |
| `extension` | string | yes | pattern=`^[a-z][a-z0-9_]{0,31}$` |

**Request body example:**

```json
{
  "enabled": false,
  "extension": "string"
}
```

**Responses:**

| Status | Schema | Description |
|--------|--------|-------------|
| `200` | `ApiSuccess_dict_str__Any__` | Successful Response |
| `422` | `HTTPValidationError` | Validation Error |

**Response example (200):**

```json
{
  "data": {},
  "message": "",
  "status": "success",
  "warnings": [
    "string"
  ]
}
```

**cURL example:**

```bash
curl -X PUT \
  -H "X-WHost-Key: $WHOST_API_KEY" \
  -H "X-WHost-Timestamp: $(date +%s)" \
  -H "X-WHost-Nonce: $(openssl rand -hex 16)" \
  -H "X-WHost-Signature: $(compute_hmac)" \
  -H "Content-Type: application/json" \
  -d @body.json \
  https://your-server:2000/api/v1/client/php/extensions
```

---

<a id="get-api-v1-client-php-opcache"></a>
#### `GET /api/v1/client/php/opcache`

*Get OPcache status (client)*

Return the OPcache statistics for the PHP version assigned to the authenticated client account.

**Responses:**

| Status | Schema | Description |
|--------|--------|-------------|
| `200` | `ApiSuccess_dict_str__Any__` | Successful Response |

**Response example (200):**

```json
{
  "data": {},
  "message": "",
  "status": "success",
  "warnings": [
    "string"
  ]
}
```

**cURL example:**

```bash
curl -X GET \
  -H "X-WHost-Key: $WHOST_API_KEY" \
  -H "X-WHost-Timestamp: $(date +%s)" \
  -H "X-WHost-Nonce: $(openssl rand -hex 16)" \
  -H "X-WHost-Signature: $(compute_hmac)" \
  https://your-server:2000/api/v1/client/php/opcache
```

---

<a id="post-api-v1-client-php-opcache-clear"></a>
#### `POST /api/v1/client/php/opcache/clear`

*Clear OPcache (client)*

Clear the OPcache for the PHP version assigned to the authenticated client account.

**Responses:**

| Status | Schema | Description |
|--------|--------|-------------|
| `200` | `MessageResponse` | Successful Response |

**Response example (200):**

```json
{
  "message": "string",
  "status": "success"
}
```

**cURL example:**

```bash
curl -X POST \
  -H "X-WHost-Key: $WHOST_API_KEY" \
  -H "X-WHost-Timestamp: $(date +%s)" \
  -H "X-WHost-Nonce: $(openssl rand -hex 16)" \
  -H "X-WHost-Signature: $(compute_hmac)" \
  https://your-server:2000/api/v1/client/php/opcache/clear
```

---

<a id="get-api-v1-client-php-versions"></a>
#### `GET /api/v1/client/php/versions`

*Get installed PHP versions (client)*

Return the list of installed PHP versions and the default version available to the authenticated client.

**Responses:**

| Status | Schema | Description |
|--------|--------|-------------|
| `200` | `ApiSuccess_dict_str__Any__` | Successful Response |

**Response example (200):**

```json
{
  "data": {},
  "message": "",
  "status": "success",
  "warnings": [
    "string"
  ]
}
```

**cURL example:**

```bash
curl -X GET \
  -H "X-WHost-Key: $WHOST_API_KEY" \
  -H "X-WHost-Timestamp: $(date +%s)" \
  -H "X-WHost-Nonce: $(openssl rand -hex 16)" \
  -H "X-WHost-Signature: $(compute_hmac)" \
  https://your-server:2000/api/v1/client/php/versions
```

---
