CorefinityCorefinityDocs
Open the Control PanelControl Panel
PHP · 4 of 11

Copy PHP configuration to other environments

Copies this site's PHP configuration, without Xdebug, to other environments of the same site. The request is checked whole first, so a refusal applies nothing anywhere; then each target is changed on its own, and the answer has one entry for each in the order asked.

POST/api/corestack/sites/{site}/php-runtime/apply-to

Path parameters

siteintegerRequired

The id of a site row. A website's production site and each of its environments has its own id. Digits only. At least 1.

Body

applystring

When a change that needs a maintenance window is applied. now applies it at once. tonight queues it for the site's next window. window means the same as tonight. An endpoint that takes window only while maintenance windows are on for your company says so, and refuses it 422 on apply otherwise. Defaults to now.

nowtonightwindow
confirm_productionboolean

Must be true when a target is production. Defaults to false.

partsarray of stringsRequired

What to copy. ini is the custom php.ini.

extensionssettingsfpmini
targetsarray of integersRequired

The ids of the environments to copy to, each once. Each must be another environment of this site that you may change. Up to 20 items.

Returns

200 One entry for each target, in the order asked.

Fields of the 200 answer
changesarray of objectsRequired
Fields of each item
adoptingbooleanRequired
item_idinteger or null

At least 1.

operationobject or any or nullRequired

The operation that applies the copy on this target. Null when nothing differs, when it was queued and when the target refused.

queuedboolean
refusedobject or any or nullRequired

Why this target refused, with the status a change of it would answer. Null when it did not.

site_idintegerRequired

At least 1.

warningsarray of objectsRequired
Fields of each item
codestringRequired
messagestringRequired
windowobject or any or null
window_datestring

If it is refused

StatusReasonWhat to do
401noneSend a valid token as Authorization: Bearer <token>.
403company_unavailableYour company is unavailable.
403scope_requiredUse a token with the scope named in scope.
403two_factor_requiredTurn on two-factor on your account, then send again.
404feature_offThis feature is not on for your organisation yet.
409managed_elsewhereThis site is read-only here. Change it in the control panel that manages it.
422confirmThe action needs an explicit confirmation field. Ask the person, then send it.
422copy_target_invalidPHP settings can only be copied to another environment of this site.
429rate_limitedWait for the seconds in Retry-After.

Reasons are listed by name in Errors and refusals.

The same task elsewhere

curl -X POST https://manage.corefinity.com/api/corestack/sites/1042/php-runtime/apply-to \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "parts": [
      "settings",
      "ini"
    ],
    "targets": [
      1043
    ]
  }'
{
  "changes": [
    {
      "adopting": false,
      "operation": {
        "applied_at": null,
        "can_retry": false,
        "cluster": {
          "id": 1017,
          "name": "Northwind UK 1"
        },
        "committed_at": "2026-11-09T21:35:24Z",
        "completed_at": null,
        "created_at": "2026-11-09T21:35:24Z",
        "environment": {
          "env_id": "rs-northwind-harbourandfinch-example-com--staging",
          "hostname": "staging-harbourandfinch-example-com.northwind.cfstack.example.net",
          "id": 1043,
          "name": "Staging",
          "role": "staging",
          "role_label": "Staging",
          "slug": "staging"
        },
        "error": null,
        "failure_reason": null,
        "from_version": null,
        "hot": false,
        "id": 5121,
        "install": null,
        "label": "Picked up by PHP",
        "notes": [],
        "parent_operation_id": null,
        "requested_by": {
          "id": 2012,
          "name": "Daniel Reyes"
        },
        "reset_target": null,
        "result": null,
        "result_state": "none",
        "retried_by_operation_id": null,
        "retries_operation_id": null,
        "retry_requires": null,
        "revealed": null,
        "scope": "site",
        "site": {
          "domain": "harbourandfinch.example.com",
          "id": 1043
        },
        "status": "committed",
        "status_label": "Waiting for the platform",
        "step": "applied",
        "steps": [
          {
            "key": "saved",
            "label": "Saved",
            "state": "done"
          },
          {
            "key": "applied",
            "label": "Picked up by PHP",
            "state": "current"
          },
          {
            "key": "healthy",
            "label": "Requests answered",
            "state": "todo"
          }
        ],
        "subject": null,
        "summary": "PHP configuration",
        "to_version": null,
        "type": "php_runtime",
        "type_label": "PHP configuration"
      },
      "refused": null,
      "site_id": 1043,
      "warnings": []
    }
  ]
}
Try it

Try it is off for this endpointIt overwrites data that cannot be brought back. Copy the request and run it yourself when you are sure.

Was this helpful?
Open in ClaudeOpen in ChatGPT