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

**Change PHP settings.** Set a row's memory limit, upload size and execution time, within the bounds corestack_php_settings_get shows, at its `version`; now or tonight. Scope: write. Long-running: answers with a task.

- Scope: `write`
- Runs as a task: yes

## When to use it

Set a row's memory limit, upload size and execution time, within the bounds corestack_php_settings_get shows, at its `version`; now or tonight.

## Inputs

- `site_id` (integer, ≥ 1, required): The row: the site or one of its environments.
- `version` (integer, ≥ 0, required): From corestack_php_settings_get.
- `memory_limit_bytes` (integer, ≥ 1, required)
- `upload_max_filesize_bytes` (integer, ≥ 1, required)
- `max_execution_time_seconds` (integer, ≥ 1, required)
- `apply` (one of `now`, `tonight`, default `"now"`): now (the default), or tonight in the row's maintenance window.
- `app_cache_header` (boolean, optional): the row's application cache header. `false` opts the row out: the platform stops reporting whether the application's own page cache answered, so its traffic figures show the cached share as "not reported". `true` opts it back in. Saved at once, also when `apply` is `tonight`; send the three settings as corestack_php_settings_get shows them to change only this. The site itself is changed first (it takes effect within seconds where `runtime_ready` is `true`, otherwise when the row's runtime is updated), and only then the three settings: a site that cannot be reached is refused `unavailable` and nothing at all is changed, and if the three settings are then refused, `app_cache_header` is put back as it was. WordPress rows only. Present only while the person's Control Panel offers it (corestack_php_settings_get then answers `app_cache_header` `{enabled, applies}`); otherwise naming it is `invalid_arguments`.

### Input schema

```json
{
  "additionalProperties": false,
  "properties": {
    "apply": {
      "default": "now",
      "description": "now (the default), or tonight in the row's maintenance window. window: the row's next maintenance window (tonight is kept as its alias).",
      "enum": [
        "now",
        "window",
        "tonight"
      ],
      "type": "string"
    },
    "max_execution_time_seconds": {
      "minimum": 1,
      "type": "integer"
    },
    "memory_limit_bytes": {
      "minimum": 1,
      "type": "integer"
    },
    "site_id": {
      "description": "The row: the site or one of its environments.",
      "minimum": 1,
      "type": "integer"
    },
    "upload_max_filesize_bytes": {
      "minimum": 1,
      "type": "integer"
    },
    "version": {
      "description": "From corestack_php_settings_get.",
      "minimum": 0,
      "type": "integer"
    }
  },
  "required": [
    "site_id",
    "version",
    "memory_limit_bytes",
    "upload_max_filesize_bytes",
    "max_execution_time_seconds"
  ],
  "type": "object"
}
```

## Refusals

- `invalid_arguments`: a value outside the row's bounds or steps (memory in whole steps, an execution time the row offers); `fields.<argument>` says what is allowed (corestack_php_settings_get gives the bounds).
- `stale`: the settings changed since you read them; read corestack_php_settings_get again and call with its new `version`.
- `feature_off`: `apply: "tonight"` needs the maintenance window queue, which is switched off; leave `apply` out to make the change now.
- `change_pending`: a change is already queued for this row's maintenance window; apply or cancel it first (corestack_pending_changes_list).
- `switched_off`: the `exec` kill switch is off, which also stops every PHP change on a row already on the new runtime, and every `app_cache_header` change; nothing was changed; stop and tell the person.
- `unavailable`: `app_cache_header` could not be put into the site (it is not running or could not be reached just now); nothing was saved, the three settings included; try again in a minute (if the message says the site did not confirm the change, the next attempt puts the site in line first).
- `busy`, `deployment_running`, `command_running`, `exec_unresolved`: with `app_cache_header`, something else is running on the site (a change, a deployment or its rollback, a command); nothing was changed; try again once it has finished (corestack_site_operations_list).
- `runtime_locked`: on a row on the new runtime: Corefinity has locked its PHP configuration, so nothing was changed; tell the person (Corefinity support can unlock it).
- `removed`: the row has been removed.
- `deleted`: the site is deleted (in its grace period); restore it with corestack_site_restore_deleted first.
- `provisioning`: the site is still being created; wait for corestack_site_provisioning_get to finish.
- `not_available`: this row's PHP settings are not managed here (a custom tier, or a row the Control Panel does not manage these settings for). On `app_cache_header` (`fields`): the row is not WordPress, so the platform sends no application cache header there to opt out of; nothing was changed.
- `conflict`: the row's PHP files were changed outside the Control Panel, and Corefinity staff review them before the next change; nothing was changed; tell the person.
- `managed_elsewhere` (message: "This site is managed by another control panel"): another control panel manages this site, so use that control panel for it. This is refused before anything else about the site, as in the Control Panel and the API. Nothing was done.
- 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_settings_update",
  "arguments": {
    "site_id": 4211,
    "version": 3,
    "memory_limit_bytes": 805306368,
    "upload_max_filesize_bytes": 67108864,
    "max_execution_time_seconds": 120
  }
}
```

## Prompt

```text
Using the Corefinity MCP server, call corestack_php_settings_update with site_id 4211, version 3, memory_limit_bytes 805306368, upload_max_filesize_bytes 67108864, max_execution_time_seconds 120. (Change PHP settings.) Tell me what it returned.
```

## The same task elsewhere

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