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.
Path parameters
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
The php.ini text to check.
Draft extensions to check it against.
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
Fields of each item
Such as locked for a directive the platform keeps fixed.
error or warning.
Each directive the php.ini sets, with its value before and after.
Fields of each item
Where the value before comes from, such as custom, setting, platform or image.
False when a diagnostic is an error.
If it is refused
| Status | Reason | What to do |
|---|---|---|
401 | none | Send a valid token as Authorization: Bearer <token>. |
403 | company_unavailable | Your company is unavailable. |
403 | scope_required | Use a token with the scope named in scope. |
403 | two_factor_required | Turn on two-factor on your account, then send again. |
404 | feature_off | This feature is not on for your organisation yet. |
409 | managed_elsewhere | This site is read-only here. Change it in the control panel that manages it. |
422 | invalid | Fix the field named in field; errors says why. |
429 | rate_limited | Wait 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"
}'use Illuminate\Support\Facades\Http;
$response = Http::withToken(env('COREFINITY_TOKEN'))
->acceptJson()
->post('https://manage.corefinity.com/api/corestack/sites/1042/php-runtime/validate', [
'custom_ini' => '
open_basedir = /
',
]);
$data = $response->json();const res = await fetch('https://manage.corefinity.com/api/corestack/sites/1042/php-runtime/validate', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
custom_ini: '\nopen_basedir = /\n',
}),
});
// An answer with no body (204) has nothing to parse.
const text = await res.text();
const data = text && JSON.parse(text);import os
import requests
res = requests.post(
"https://manage.corefinity.com/api/corestack/sites/1042/php-runtime/validate",
headers={
"Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
"Accept": "application/json",
},
json={
"custom_ini": "\nopen_basedir = /\n",
},
)
data = res.json() if res.content else None{
"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
}{
"message": "Unauthenticated."
}{
"code": "company_unavailable",
"message": "Your company is unavailable.",
"reason": "company_unavailable"
}{
"code": "feature_off",
"message": "Not found.",
"reason": "feature_off"
}{
"code": "managed_elsewhere",
"message": "This site is managed by another control panel",
"reason": "managed_elsewhere"
}{
"code": "invalid",
"diagnostics": [],
"errors": [
{
"code": "invalid",
"field": "php_version",
"message": "php_version is not one of version, extensions, settings, fpm, xdebug, custom_ini, apply."
}
],
"field": "php_version",
"message": "php_version is not one of version, extensions, settings, fpm, xdebug, custom_ini, apply.",
"reason": "invalid"
}{
"code": "rate_limited",
"message": "Too many requests. Try again in 60 seconds.",
"reason": "rate_limited",
"retry_after_seconds": 60
}