---
title: "corestack_php_ini_test"
url: https://docs.corefinity.com/mcp/tools/corestack_php_ini_test
type: tool
last_updated: 2026-11-13
feature: php-settings
related:
  - https://docs.corefinity.com/api/reference/runtime/test-php-ini.md
  - https://docs.corefinity.com/guides/sites/software-and-services/php-settings-and-php-ini.md
---
# corestack_php_ini_test

**Test a php.ini on the site.** Start the row's PHP once with a candidate php.ini, with every customer execution hook switched off so no site code runs, and answer PHP's startup warnings and the values it took. Nothing is saved. Scope: exec.

- Scope: `exec`
- Runs as a task: no

## When to use it

Try a candidate php.ini on the row's own PHP before saving it. The row's PHP starts once with the candidate and with every customer execution hook switched off (auto_prepend_file and the rest), so no site code runs; the answer is whether PHP started (`completed`), the warnings it printed while starting (`startup`) and the value it took for each directive the candidate sets (`effective`; a switched-off hook is reported as configured, `measured: false`). A php.ini with an error is refused and nothing runs. Nothing is saved. Needs exec.

## Inputs

- `site_id` (integer, ≥ 1, required): The row: the site or one of its environments.
- `custom_ini` (string, required): The whole custom php.ini to test.
- `settings` (object): Draft form settings to test it with, {directive: value}.
- `extensions` (array of string, up to 200 items): Draft extensions to test it with.

### Input schema

```json
{
  "additionalProperties": false,
  "properties": {
    "custom_ini": {
      "description": "The whole custom php.ini to test.",
      "type": "string"
    },
    "extensions": {
      "description": "Draft extensions to test it with.",
      "items": {
        "maxLength": 64,
        "type": "string"
      },
      "maxItems": 200,
      "type": "array"
    },
    "settings": {
      "description": "Draft form settings to test it with, {directive: value}.",
      "type": "object"
    },
    "site_id": {
      "description": "The row: the site or one of its environments.",
      "minimum": 1,
      "type": "integer"
    }
  },
  "required": [
    "site_id",
    "custom_ini"
  ],
  "type": "object"
}
```

## Refusals

- `ini_invalid`: the php.ini has an error; `details.diagnostics` lists each one and nothing ran. Fix it (corestack_php_ini_validate) and try again.
- `runtime_not_adopted`: this environment does not run the runtime component yet, so a php.ini cannot be tested on it.
- `not_running`: the site is not running; start it first.
- `busy`: another change is running on the site; try again when it has finished.
- `managed_elsewhere`: another control panel manages this site.
- `switched_off`: running commands on sites is switched off at the moment.
- `upstream_unavailable`: the test did not run to the end on the site; try again in a moment.
- `feature_off`: PHP configuration is not switched on in the Control Panel yet.
- The refusals every tool can answer: `invalid_arguments`, `tenant_mismatch`, `scope_required`, `pin_refused`, `rate_limited`, `temporarily_unavailable`, `internal_error` (corestack://guides/how-this-server-works).

## Example

```json
{
  "name": "corestack_php_ini_test",
  "arguments": {
    "site_id": 4211,
    "custom_ini": "max_input_vars = 5000\nrealpath_cache_size = 8M\n"
  }
}
```

## Prompt

```text
Using the Corefinity MCP server, call corestack_php_ini_test with site_id 4211, custom_ini max_input_vars = 5000
realpath_cache_size = 8M
. (Test a php.ini on the site.) Tell me what it returned.
```

## The same task elsewhere

- Endpoint: [POST /api/corestack/sites/{site}/php-runtime/test](https://docs.corefinity.com/api/reference/runtime/test-php-ini.md)
- Guide: [PHP configuration](https://docs.corefinity.com/guides/sites/software-and-services/php-settings-and-php-ini.md)
