curl --request PUT \
--url https://app.sandywp.com/api/app/sites/{id}/php-config \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"maxExecutionTime": 155,
"maxInputTime": 155,
"maxInputVars": 5050,
"memoryLimitMb": 288,
"allowUrlFopen": true,
"postMaxSizeMb": 2564,
"uploadMaxFilesizeMb": 2561,
"sessionGcMaxlifetime": 43350,
"outputBufferingBytes": 32768
}
'import requests
url = "https://app.sandywp.com/api/app/sites/{id}/php-config"
payload = {
"maxExecutionTime": 155,
"maxInputTime": 155,
"maxInputVars": 5050,
"memoryLimitMb": 288,
"allowUrlFopen": True,
"postMaxSizeMb": 2564,
"uploadMaxFilesizeMb": 2561,
"sessionGcMaxlifetime": 43350,
"outputBufferingBytes": 32768
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
maxExecutionTime: 155,
maxInputTime: 155,
maxInputVars: 5050,
memoryLimitMb: 288,
allowUrlFopen: true,
postMaxSizeMb: 2564,
uploadMaxFilesizeMb: 2561,
sessionGcMaxlifetime: 43350,
outputBufferingBytes: 32768
})
};
fetch('https://app.sandywp.com/api/app/sites/{id}/php-config', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.sandywp.com/api/app/sites/{id}/php-config",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'maxExecutionTime' => 155,
'maxInputTime' => 155,
'maxInputVars' => 5050,
'memoryLimitMb' => 288,
'allowUrlFopen' => true,
'postMaxSizeMb' => 2564,
'uploadMaxFilesizeMb' => 2561,
'sessionGcMaxlifetime' => 43350,
'outputBufferingBytes' => 32768
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.sandywp.com/api/app/sites/{id}/php-config"
payload := strings.NewReader("{\n \"maxExecutionTime\": 155,\n \"maxInputTime\": 155,\n \"maxInputVars\": 5050,\n \"memoryLimitMb\": 288,\n \"allowUrlFopen\": true,\n \"postMaxSizeMb\": 2564,\n \"uploadMaxFilesizeMb\": 2561,\n \"sessionGcMaxlifetime\": 43350,\n \"outputBufferingBytes\": 32768\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://app.sandywp.com/api/app/sites/{id}/php-config")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"maxExecutionTime\": 155,\n \"maxInputTime\": 155,\n \"maxInputVars\": 5050,\n \"memoryLimitMb\": 288,\n \"allowUrlFopen\": true,\n \"postMaxSizeMb\": 2564,\n \"uploadMaxFilesizeMb\": 2561,\n \"sessionGcMaxlifetime\": 43350,\n \"outputBufferingBytes\": 32768\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.sandywp.com/api/app/sites/{id}/php-config")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"maxExecutionTime\": 155,\n \"maxInputTime\": 155,\n \"maxInputVars\": 5050,\n \"memoryLimitMb\": 288,\n \"allowUrlFopen\": true,\n \"postMaxSizeMb\": 2564,\n \"uploadMaxFilesizeMb\": 2561,\n \"sessionGcMaxlifetime\": 43350,\n \"outputBufferingBytes\": 32768\n}"
response = http.request(request)
puts response.read_body{
"phpConfig": {
"maxExecutionTime": 155,
"maxInputTime": 155,
"maxInputVars": 5050,
"memoryLimitMb": 288,
"allowUrlFopen": true,
"postMaxSizeMb": 2564,
"uploadMaxFilesizeMb": 2561,
"sessionGcMaxlifetime": 43350,
"outputBufferingBytes": 32768
},
"jobId": "<string>"
}{
"error": {
"code": "invalid_php_config",
"message": "Max execution time must be a whole number.",
"details": {}
}
}{
"error": {
"code": "auth_required",
"message": "A logged-in user is required.",
"details": {}
}
}{
"error": {
"code": "capability_required",
"message": "Your role does not allow this.",
"details": {
"capability": "internals"
}
}
}{
"error": {
"code": "site_not_found",
"message": "Site not found.",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}Replace PHP ini configuration
Sets the sandbox’s PHP ini values (async apply_php_config job). Every field below is required on every call — the server validates and rewrites the complete configuration object each time; a request missing any field is rejected with 400 invalid_php_config naming the missing/invalid field. (The dashboard’s own hand-written API guide describes this endpoint as accepting a partial update where “only the ones you send change” — that is not what the deployed handler does; treat this schema, not that prose, as authoritative and always send the full object, e.g. seeded from a prior GET.) The sandbox must be ready. memoryLimitMb’s effective maximum is dynamic — see limits.memoryLimitMaxMb on the GET response for this sandbox — and uploadMaxFilesizeMb must not exceed postMaxSizeMb.
curl --request PUT \
--url https://app.sandywp.com/api/app/sites/{id}/php-config \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"maxExecutionTime": 155,
"maxInputTime": 155,
"maxInputVars": 5050,
"memoryLimitMb": 288,
"allowUrlFopen": true,
"postMaxSizeMb": 2564,
"uploadMaxFilesizeMb": 2561,
"sessionGcMaxlifetime": 43350,
"outputBufferingBytes": 32768
}
'import requests
url = "https://app.sandywp.com/api/app/sites/{id}/php-config"
payload = {
"maxExecutionTime": 155,
"maxInputTime": 155,
"maxInputVars": 5050,
"memoryLimitMb": 288,
"allowUrlFopen": True,
"postMaxSizeMb": 2564,
"uploadMaxFilesizeMb": 2561,
"sessionGcMaxlifetime": 43350,
"outputBufferingBytes": 32768
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
maxExecutionTime: 155,
maxInputTime: 155,
maxInputVars: 5050,
memoryLimitMb: 288,
allowUrlFopen: true,
postMaxSizeMb: 2564,
uploadMaxFilesizeMb: 2561,
sessionGcMaxlifetime: 43350,
outputBufferingBytes: 32768
})
};
fetch('https://app.sandywp.com/api/app/sites/{id}/php-config', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.sandywp.com/api/app/sites/{id}/php-config",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'maxExecutionTime' => 155,
'maxInputTime' => 155,
'maxInputVars' => 5050,
'memoryLimitMb' => 288,
'allowUrlFopen' => true,
'postMaxSizeMb' => 2564,
'uploadMaxFilesizeMb' => 2561,
'sessionGcMaxlifetime' => 43350,
'outputBufferingBytes' => 32768
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.sandywp.com/api/app/sites/{id}/php-config"
payload := strings.NewReader("{\n \"maxExecutionTime\": 155,\n \"maxInputTime\": 155,\n \"maxInputVars\": 5050,\n \"memoryLimitMb\": 288,\n \"allowUrlFopen\": true,\n \"postMaxSizeMb\": 2564,\n \"uploadMaxFilesizeMb\": 2561,\n \"sessionGcMaxlifetime\": 43350,\n \"outputBufferingBytes\": 32768\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://app.sandywp.com/api/app/sites/{id}/php-config")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"maxExecutionTime\": 155,\n \"maxInputTime\": 155,\n \"maxInputVars\": 5050,\n \"memoryLimitMb\": 288,\n \"allowUrlFopen\": true,\n \"postMaxSizeMb\": 2564,\n \"uploadMaxFilesizeMb\": 2561,\n \"sessionGcMaxlifetime\": 43350,\n \"outputBufferingBytes\": 32768\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.sandywp.com/api/app/sites/{id}/php-config")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"maxExecutionTime\": 155,\n \"maxInputTime\": 155,\n \"maxInputVars\": 5050,\n \"memoryLimitMb\": 288,\n \"allowUrlFopen\": true,\n \"postMaxSizeMb\": 2564,\n \"uploadMaxFilesizeMb\": 2561,\n \"sessionGcMaxlifetime\": 43350,\n \"outputBufferingBytes\": 32768\n}"
response = http.request(request)
puts response.read_body{
"phpConfig": {
"maxExecutionTime": 155,
"maxInputTime": 155,
"maxInputVars": 5050,
"memoryLimitMb": 288,
"allowUrlFopen": true,
"postMaxSizeMb": 2564,
"uploadMaxFilesizeMb": 2561,
"sessionGcMaxlifetime": 43350,
"outputBufferingBytes": 32768
},
"jobId": "<string>"
}{
"error": {
"code": "invalid_php_config",
"message": "Max execution time must be a whole number.",
"details": {}
}
}{
"error": {
"code": "auth_required",
"message": "A logged-in user is required.",
"details": {}
}
}{
"error": {
"code": "capability_required",
"message": "Your role does not allow this.",
"details": {
"capability": "internals"
}
}
}{
"error": {
"code": "site_not_found",
"message": "Site not found.",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}Authorizations
Personal API token, sent as Authorization: Bearer <SANDYWP_API_KEY>. Obtain one from the dashboard account menu (API keys), sandywp auth login, or POST /api/account/tokens. A missing or invalid token returns 401 auth_required. Scoped OAuth tokens are limited to the Imports family and GET /api/account/me; see the top-level conventions.
Headers
Selects which of the caller's workspaces to act in, for accounts belonging to more than one (legacy alias: X-SandyWP-Organization). Defaults to the caller's own personal workspace when omitted. Every id in this API (sandboxes, Templates, repositories) is scoped to a single workspace, so this header changes which set of resources is visible.
Path Parameters
The sandbox id.
Body
A sandbox's PHP ini overrides. All fields are required both when read back from GET .../php-config and when written via PUT .../php-config (the PUT endpoint replaces the whole object — see that operation's description for why this differs from what the hand-written API guide says).
Seconds. max_execution_time.
10 <= x <= 300Seconds. max_input_time.
10 <= x <= 300max_input_vars.
100 <= x <= 10000MB. memory_limit. The static maximum is 512, but the effective ceiling for a given sandbox is usually lower — see limits.memoryLimitMaxMb on the GET response.
64 <= x <= 512allow_url_fopen.
MB. post_max_size.
8 <= x <= 5120MB. upload_max_filesize. Must not exceed postMaxSizeMb.
2 <= x <= 5120Seconds. session.gc_maxlifetime.
300 <= x <= 86400Bytes (0 disables). output_buffering.
0 <= x <= 65536Response
The applied PHP configuration and, if a change was queued, its job id.
A sandbox's PHP ini overrides. All fields are required both when read back from GET .../php-config and when written via PUT .../php-config (the PUT endpoint replaces the whole object — see that operation's description for why this differs from what the hand-written API guide says).
Show child attributes
Show child attributes
The queued apply_php_config job id, or null if the request was a no-op.

