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

Check a php.ini

Checks a custom php.ini against the configuration a save would have, or against the draft settings and extensions you send. Nothing is saved and nothing runs on the site. The token needs only read, but the person must be able to change the site.

POST/api/corestack/sites/{site}/php-runtime/validate

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

custom_inistringRequired

The php.ini text to check.

extensionsarray of strings

Draft extensions to check it against.

settingsobject

Draft settings to check it against, as a change sends them.

Returns

200 The check. ok is false when a diagnostic is an error.

Fields of the 200 answer
diagnosticsarray of objectsRequired
Fields of each item
codestringRequired

Such as locked for a directive the platform keeps fixed.

columninteger
end_columninteger
lineintegerRequired
messagestringRequired
severitystringRequired

error or warning.

effectivearray of objectsRequired

Each directive the php.ini sets, with its value before and after.

Fields of each item
afterstring or nullRequired
beforestring or nullRequired
directivestringRequired
layerstringRequired

Where the value before comes from, such as custom, setting, platform or image.

okbooleanRequired

False when a diagnostic is an error.

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.
422invalidFix the field named in field; errors says why.
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/validate \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "custom_ini": "\nopen_basedir = /\n"
  }'
{
  "diagnostics": [
    {
      "code": "locked",
      "column": 1,
      "end_column": 16,
      "line": 2,
      "message": "open_basedir: The platform sets the paths PHP serves.",
      "severity": "error"
    }
  ],
  "effective": [
    {
      "after": "/",
      "before": null,
      "directive": "open_basedir",
      "layer": "image"
    }
  ],
  "ok": false
}
Try it
Held in this tab's memory only. Never stored or sent to us.

This sends a real POST request and changes your account.

Use a token with only the read scope. How to make one

Was this helpful?
Open in ClaudeOpen in ChatGPT