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

Test a php.ini

Starts the site's own PHP once on its command line with the candidate php.ini, with every way of running site code switched off, and answers whether PHP started, what it printed and the value it took for each directive. A php.ini with an error is refused ini_invalid and nothing runs. Nothing is saved.

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

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 test.

extensionsarray of strings

Draft extensions to test it with.

settingsobject

Draft settings to test it with, as a change sends them.

Returns

200 The test ran. completed is false when PHP did not start with the candidate.

Fields of the 200 answer
completedbooleanRequired

True when PHP started with the candidate.

effectivearray of objectsRequired

The value PHP took for each directive the candidate sets.

Fields of each item
directivestringRequired
measuredbooleanRequired

False for a directive the test switches off, whose value is the configured one.

valuestring or nullRequired
startuparray of stringsRequired

The warnings and errors PHP printed as it started.

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.
409not_runningThe site, environment or deployment is not running. Read the message: where it can be started or will recover, start it or wait, then try again.
409runtime_not_adoptedThis environment does not run the runtime component yet, so its effective PHP configuration cannot be read.
422ini_invalidopen_basedir: The platform sets the paths PHP serves.
429rate_limitedWait for the seconds in Retry-After.
502upstream_unavailableA service the action depends on did not answer. Try again later.
503connect_failedThe cluster could not be reached.
503temporarily_unavailableThe Control Panel could not answer just now. Nothing was started; try again shortly.
503switched_offCorefinity has switched this action off for the moment. Try again later.

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/test \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "custom_ini": "realpath_cache_size = 16M\n"
  }'
{
  "completed": true,
  "effective": [
    {
      "directive": "max_execution_time",
      "measured": true,
      "value": "0"
    },
    {
      "directive": "max_input_vars",
      "measured": true,
      "value": "20000"
    },
    {
      "directive": "max_memory_limit",
      "measured": false,
      "value": null
    },
    {
      "directive": "memory_limit",
      "measured": true,
      "value": "512M"
    },
    {
      "directive": "post_max_size",
      "measured": false,
      "value": null
    },
    {
      "directive": "realpath_cache_size",
      "measured": true,
      "value": "8M"
    },
    {
      "directive": "upload_max_filesize",
      "measured": true,
      "value": "256M"
    }
  ],
  "startup": []
}
Try it

Try it is off for this endpointIt runs commands on a live site. Copy the request and run it yourself when you are sure.

Was this helpful?
Open in ClaudeOpen in ChatGPT