---
title: "Get what the application needs from PHP"
url: https://docs.corefinity.com/api/reference/runtime/get-php-requirements
type: endpoint
last_updated: 2026-11-13
feature: php-runtime
related:
  - https://docs.corefinity.com/guides/sites/software-and-services/php-version.md
  - https://docs.corefinity.com/mcp/tools/corestack_php_requirements_get.md
---
# Get what the application needs from PHP

Answers what the application asks of PHP, as last read from the site, with any extensions it needs that are not
loaded and whether the PHP version is outside the range it accepts. `refresh=1` reads the site again first, at
most once every ten minutes. Try-it is off because that read runs a command on the site.

```http
GET /api/corestack/sites/{site}/php-runtime/requirements
```

- Scope: `read`
- Two-factor: required on your account (all)
- Rate limit: 20 a minute
- Try it in the console: off. It has not been cleared for the console. Copy the request and run it yourself when you are sure.

## Path parameters

- `site` (integer, required): The id of a site row. A website's production site and each of its environments has its own id. Digits only.

## Query parameters

- `refresh` (string): Send `1` to read the running site again before answering.

## Request

### curl

```bash
curl https://manage.corefinity.com/api/corestack/sites/1042/php-runtime/requirements \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json"
```

### PHP

```php
use Illuminate\Support\Facades\Http;

$response = Http::withToken(env('COREFINITY_TOKEN'))
    ->acceptJson()
    ->get('https://manage.corefinity.com/api/corestack/sites/1042/php-runtime/requirements');

$data = $response->json();
```

### Node

```javascript
const res = await fetch('https://manage.corefinity.com/api/corestack/sites/1042/php-runtime/requirements', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
    Accept: 'application/json',
  },
});

// An answer with no body (204) has nothing to parse.
const text = await res.text();
const data = text && JSON.parse(text);
```

### Python

```python
import os
import requests

res = requests.get(
    "https://manage.corefinity.com/api/corestack/sites/1042/php-runtime/requirements",
    headers={
        "Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
        "Accept": "application/json",
    },
)

data = res.json() if res.content else None
```

## Responses

### 200 The requirements. Every field is null or empty until the site has been read once.

```json
{
  "application": {
    "name": "WordPress",
    "version": "6.8.3"
  },
  "ext": {
    "by": {
      "imagick": [
        "wordpress"
      ]
    },
    "required": [
      "ext-json",
      "ext-mysqli",
      "ext-imagick"
    ]
  },
  "missing_extensions": [
    "imagick"
  ],
  "outside_range": false,
  "php": {
    "constraint": ">=7.4",
    "packages": [],
    "range": "8.4"
  },
  "read_at": "2026-11-08T09:16:40Z",
  "source": "probe"
}
```

### 401 No token, or a token that is not valid.

```json
{
  "message": "Unauthenticated."
}
```

### 403 The token lacks the scope (`scope_required`, with the `scope` to use), or your company requires two-factor authentication and you have not set it up. For routes outside Managed Clusters.

```json
{
  "code": "company_unavailable",
  "message": "Your company is unavailable.",
  "reason": "company_unavailable"
}
```

### 404 The id does not exist or is something you cannot see, or the feature is not on for your company (`feature_off`).

```json
{
  "code": "feature_off",
  "message": "Not found.",
  "reason": "feature_off"
}
```

### 409 Only with `refresh`. The site is not running (`not_running`), an earlier command on it has not been confirmed stopped (`exec_unresolved`), or its files are not laid out as a release the Control Panel deployed, so the requirements cannot be read (`layout_unknown`).

```json
{
  "code": "layout_unknown",
  "message": "The site's htdocs is not a release the control panel deployed, so the application's requirements cannot be read from it.",
  "reason": "layout_unknown"
}
```

### 422 Only with `refresh`. The application's requirements could not be read from its files (`requirements_unreadable`).

```json
{
  "code": "string",
  "detail_reason": "string",
  "message": "string",
  "reason": "string"
}
```

### 429 Too many requests (`rate_limited`). Wait for the number of seconds in `Retry-After`, which `retry_after_seconds` repeats.

```json
{
  "code": "rate_limited",
  "message": "Too many requests. Try again in 60 seconds.",
  "reason": "rate_limited",
  "retry_after_seconds": 60
}
```

### 503 The read runs a command on the site, and Corefinity has switched commands on sites off for the moment (`switched_off`), the site's cluster could not be reached (`connect_failed`), or the site's files could not be read (`temporarily_unavailable`). Try again later.

```json
{
  "code": "connect_failed",
  "message": "The cluster could not be reached",
  "reason": "connect_failed"
}
```

## If it is refused

| Status | Reason | What to do |
|---|---|---|
| 401 |  | Send a valid token as `Authorization: Bearer <token>`. |
| 403 | `company_unavailable` | Your company is unavailable. |
| 403 | `scope_required` | Use a token with the scope named in `scope`. |
| 403 | `two_factor_required` | Turn on two-factor on your account, then send again. |
| 404 | `feature_off` | This feature is not on for your organisation yet. |
| 409 | `layout_unknown` | The site's htdocs is not a release the control panel deployed, so the application's requirements cannot be read from it. |
| 409 | `not_running` | The site, environment or deployment is not running. Read the message: where it can be started or will recover, start it or wait, then try again. |
| 422 | `string` | string. |
| 429 | `rate_limited` | Wait for the seconds in `Retry-After`. |
| 503 | `connect_failed` | The cluster could not be reached. |
| 503 | `temporarily_unavailable` | The Control Panel could not answer just now. Nothing was started; try again shortly. |
| 503 | `switched_off` | Corefinity has switched this action off for the moment. Try again later. |

## The same task elsewhere

- Guide: [Change PHP version](https://docs.corefinity.com/guides/sites/software-and-services/php-version.md)
- MCP tool: [`corestack_php_requirements_get`](https://docs.corefinity.com/mcp/tools/corestack_php_requirements_get.md)
