CorefinityCorefinityDocs
Open the Control PanelControl Panel
PHP settings · 6 of 6

Update memory, upload and execution limits

Sets the memory limit, the upload size and the execution time, all three, within the site's bounds. Send the version of your last read. Answers 201 with the operation that applies them, 200 when nothing differs, or 202 while the platform has not yet confirmed the save.

PUT/api/corestack/sites/{site}/php-settings

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
max_execution_time_secondsintegerRequired

The execution time in seconds, one of the three on offer (bounds.max_execution_time.options).

60120300
memory_limit_bytesintegerRequired

The memory limit in bytes, from 128 MiB in steps of 64 MiB. The most this site may have depends on its platform and size, so read bounds.memory_limit (min, max, step) from the site's settings first. At least 134217728.

upload_max_filesize_bytesintegerRequired

The largest upload in bytes, from 2 MiB to 1024 MiB in steps of 1 MiB (bounds.upload_max_filesize). 2097152 to 1073741824.

versionintegerRequired

The version of your last read. At least 0.

Returns

200 Nothing differs from what the site has. operation is null.

201 The change started (operation), or was queued for the site's window (queued).

202 The change was sent and its outcome is still being established: the operation is pending. Follow it by its id; it settles as saved or as failed within a few minutes. Do not send the change again meanwhile. Poll the operation until it finishes.

Fields of the 200 answer
item_idinteger or null

At least 1.

operationobject or any or nullRequired

The operation that applies the change. Null when nothing differs and when the change was queued.

php_settingsobjectRequired

A site's memory limit, upload size and execution time, with the bounds of its platform and size.

Fields
applyobjectRequired

Whether a saved set of rules is live on the site.

Fields
applied_atstring or nullRequired
detailany

Sent only by the sets that have more to say, such as HTTP authentication.

errorstring or nullRequired
operationobject or any or nullRequired

The change that is applying the set, while one is running.

statestringRequired

Such as applied or applying.

state_labelstringRequired
boundsobjectRequired

The bounds of the platform and size, before the site's own values.

container_memory_limit_bytesintegerRequired

The memory PHP has on this site.

notesarray of objects

What the environment's creation changed to fit its size, while that still applies. Usually empty.

Fields of each item
codestringRequired

Such as php_settings_clamped.

textstringRequired
php_versionstring or nullRequired
platformstringRequired
settingsobjectRequired
Fields
max_execution_timeobjectRequired

One of the three settings with its bounds. Sizes are in bytes, times in seconds.

Fields
defaultintegerRequired
maxintegerRequired
minintegerRequired
optionsarray of integers

The only values accepted, when the setting takes a fixed list.

stepintegerRequired
unitstringRequired
bytesseconds
valueintegerRequired
memory_limitobjectRequired

One of the three settings with its bounds. Sizes are in bytes, times in seconds.

Fields
defaultintegerRequired
maxintegerRequired
minintegerRequired
optionsarray of integers

The only values accepted, when the setting takes a fixed list.

stepintegerRequired
unitstringRequired
bytesseconds
valueintegerRequired
post_max_sizeobjectRequired

Follows the upload size; it is not set on its own.

Fields
defaultintegerRequired
maxintegerRequired
minintegerRequired
optionsarray of integers

The only values accepted, when the setting takes a fixed list.

stepintegerRequired
unitstringRequired
bytesseconds
valueintegerRequired
upload_max_filesizeobjectRequired

One of the three settings with its bounds. Sizes are in bytes, times in seconds.

Fields
defaultintegerRequired
maxintegerRequired
minintegerRequired
optionsarray of integers

The only values accepted, when the setting takes a fixed list.

stepintegerRequired
unitstringRequired
bytesseconds
valueintegerRequired
tierstringRequired

The site's size.

versionintegerRequired

The write token. Send it back with a change.

queuedboolean

Sent only when the change waits for the site's window.

windowobject or any or null

Sent only with queued, while maintenance windows are on for your company.

window_datestring
Fields of the 201 answer
item_idinteger or null

At least 1.

operationobject or any or nullRequired

The operation that applies the change. Null when nothing differs and when the change was queued.

php_settingsobjectRequired

A site's memory limit, upload size and execution time, with the bounds of its platform and size.

Fields
applyobjectRequired

Whether a saved set of rules is live on the site.

Fields
applied_atstring or nullRequired
detailany

Sent only by the sets that have more to say, such as HTTP authentication.

errorstring or nullRequired
operationobject or any or nullRequired

The change that is applying the set, while one is running.

statestringRequired

Such as applied or applying.

state_labelstringRequired
boundsobjectRequired

The bounds of the platform and size, before the site's own values.

container_memory_limit_bytesintegerRequired

The memory PHP has on this site.

notesarray of objects

What the environment's creation changed to fit its size, while that still applies. Usually empty.

Fields of each item
codestringRequired

Such as php_settings_clamped.

textstringRequired
php_versionstring or nullRequired
platformstringRequired
settingsobjectRequired
Fields
max_execution_timeobjectRequired

One of the three settings with its bounds. Sizes are in bytes, times in seconds.

Fields
defaultintegerRequired
maxintegerRequired
minintegerRequired
optionsarray of integers

The only values accepted, when the setting takes a fixed list.

stepintegerRequired
unitstringRequired
bytesseconds
valueintegerRequired
memory_limitobjectRequired

One of the three settings with its bounds. Sizes are in bytes, times in seconds.

Fields
defaultintegerRequired
maxintegerRequired
minintegerRequired
optionsarray of integers

The only values accepted, when the setting takes a fixed list.

stepintegerRequired
unitstringRequired
bytesseconds
valueintegerRequired
post_max_sizeobjectRequired

Follows the upload size; it is not set on its own.

Fields
defaultintegerRequired
maxintegerRequired
minintegerRequired
optionsarray of integers

The only values accepted, when the setting takes a fixed list.

stepintegerRequired
unitstringRequired
bytesseconds
valueintegerRequired
upload_max_filesizeobjectRequired

One of the three settings with its bounds. Sizes are in bytes, times in seconds.

Fields
defaultintegerRequired
maxintegerRequired
minintegerRequired
optionsarray of integers

The only values accepted, when the setting takes a fixed list.

stepintegerRequired
unitstringRequired
bytesseconds
valueintegerRequired
tierstringRequired

The site's size.

versionintegerRequired

The write token. Send it back with a change.

queuedboolean

Sent only when the change waits for the site's window.

windowobject or any or null

Sent only with queued, while maintenance windows are on for your company.

window_datestring
Fields of the 202 answer
item_idinteger or null

At least 1.

operationobject or any or nullRequired

The operation that applies the change. Null when nothing differs and when the change was queued.

php_settingsobjectRequired

A site's memory limit, upload size and execution time, with the bounds of its platform and size.

Fields
applyobjectRequired

Whether a saved set of rules is live on the site.

Fields
applied_atstring or nullRequired
detailany

Sent only by the sets that have more to say, such as HTTP authentication.

errorstring or nullRequired
operationobject or any or nullRequired

The change that is applying the set, while one is running.

statestringRequired

Such as applied or applying.

state_labelstringRequired
boundsobjectRequired

The bounds of the platform and size, before the site's own values.

container_memory_limit_bytesintegerRequired

The memory PHP has on this site.

notesarray of objects

What the environment's creation changed to fit its size, while that still applies. Usually empty.

Fields of each item
codestringRequired

Such as php_settings_clamped.

textstringRequired
php_versionstring or nullRequired
platformstringRequired
settingsobjectRequired
Fields
max_execution_timeobjectRequired

One of the three settings with its bounds. Sizes are in bytes, times in seconds.

Fields
defaultintegerRequired
maxintegerRequired
minintegerRequired
optionsarray of integers

The only values accepted, when the setting takes a fixed list.

stepintegerRequired
unitstringRequired
bytesseconds
valueintegerRequired
memory_limitobjectRequired

One of the three settings with its bounds. Sizes are in bytes, times in seconds.

Fields
defaultintegerRequired
maxintegerRequired
minintegerRequired
optionsarray of integers

The only values accepted, when the setting takes a fixed list.

stepintegerRequired
unitstringRequired
bytesseconds
valueintegerRequired
post_max_sizeobjectRequired

Follows the upload size; it is not set on its own.

Fields
defaultintegerRequired
maxintegerRequired
minintegerRequired
optionsarray of integers

The only values accepted, when the setting takes a fixed list.

stepintegerRequired
unitstringRequired
bytesseconds
valueintegerRequired
upload_max_filesizeobjectRequired

One of the three settings with its bounds. Sizes are in bytes, times in seconds.

Fields
defaultintegerRequired
maxintegerRequired
minintegerRequired
optionsarray of integers

The only values accepted, when the setting takes a fixed list.

stepintegerRequired
unitstringRequired
bytesseconds
valueintegerRequired
tierstringRequired

The site's size.

versionintegerRequired

The write token. Send it back with a change.

queuedboolean

Sent only when the change waits for the site's window.

windowobject or any or null

Sent only with queued, while maintenance windows are on for your company.

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.
409staleWhat you read has changed since you read it. Read it again, then send the change with its new version or quote.
422invalidFix the field named in field; errors says why.
422not_availableThe tool does not apply to this object.
429rate_limitedWait for the seconds in Retry-After.
502noneRead the message; it says what happened.
503switched_offCorefinity has switched this action off for the moment. Try again later.
503unavailableThis is not available for the site or environment, or not at the moment. Read the message; try again later where it says so, or contact support.

Reasons are listed by name in Errors and refusals.

The same task elsewhere

curl -X PUT https://manage.corefinity.com/api/corestack/sites/1042/php-settings \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "max_execution_time_seconds": 120,
    "memory_limit_bytes": 536870912,
    "upload_max_filesize_bytes": 268435456,
    "version": 12
  }'
{
  "operation": null,
  "php_settings": {
    "apply": {
      "applied_at": null,
      "error": null,
      "operation": null,
      "state": "applied",
      "state_label": "Applied"
    },
    "bounds": {
      "container_memory_limit_bytes": 2617245696,
      "max_execution_time": {
        "options": [
          60,
          120,
          300
        ]
      },
      "memory_headroom_bytes": 268435456,
      "memory_limit": {
        "max": 2147483648,
        "min": 134217728,
        "step": 67108864
      },
      "platform": "wordpress",
      "post_max_size": {
        "max": 1073741824,
        "min": 2097152,
        "step": 1048576
      },
      "tier": "M",
      "upload_max_filesize": {
        "max": 1073741824,
        "min": 2097152,
        "step": 1048576
      }
    },
    "container_memory_limit_bytes": 2617245696,
    "notes": [],
    "php_version": "8.4",
    "platform": "wordpress",
    "settings": {
      "max_execution_time": {
        "default": 300,
        "max": 300,
        "min": 60,
        "options": [
          60,
          120,
          300
        ],
        "step": 60,
        "unit": "seconds",
        "value": 300
      },
      "memory_limit": {
        "default": 536870912,
        "max": 2147483648,
        "min": 134217728,
        "step": 67108864,
        "unit": "bytes",
        "value": 536870912
      },
      "post_max_size": {
        "default": 268435456,
        "max": 1073741824,
        "min": 2097152,
        "step": 1048576,
        "unit": "bytes",
        "value": 268435456
      },
      "upload_max_filesize": {
        "default": 268435456,
        "max": 1073741824,
        "min": 2097152,
        "step": 1048576,
        "unit": "bytes",
        "value": 268435456
      }
    },
    "tier": "M",
    "version": 12
  }
}
Try it

Try it is off for this endpointIt has not been cleared for the console. Copy the request and run it yourself when you are sure.

Was this helpful?
Open in ClaudeOpen in ChatGPT