PHP configuration
Change a site's PHP limits, extensions and custom php.ini, and review every change before it applies.
On this page
Before you start
- You can open the site in Managed Websites. Anyone who can open a site can change its PHP configuration.
- Each environment has its own configuration: choose Production or Staging in the site header first.
Change a setting
Open PHP configuration
Go to Managed Websites, choose the site, then Software & services under Site settings. Choose Configure… beside PHP.
Change the value
Choose the Settings tab and change a value, such as Memory limit. The line under each field gives its range; the bar at the bottom counts your changes.
Review and apply
Choose Review and apply, check the list, then choose Apply. One review applies the changes on every tab together.
The first change on an environment also turns on instant changes. After that, a change applies live and the site keeps running; if it cannot be applied, the previous settings are put back.
What each tab holds
| Tab | What you change |
|---|---|
| Extensions | Switch PHP extensions on or off. A locked extension says what needs it. |
| Settings | Limits, errors, sessions, OPcache, APCu and PHP-FPM processes. Apply preset fills the form with values suggested for your platform. |
| php.ini | Your own directives, loaded after the other tabs. |
| Tools | The command-line tools on the site, with their versions and paths. Read only. |
Max execution time is 60, 120 or 300 seconds: longer work belongs in a scheduled task. See Scheduled tasks.
Add a custom php.ini
Start the file
Choose the php.ini tab, then Start from an example or Write my own. An example is inserted as comments: remove the
;from the lines you want.Check and apply
Problems are listed under the editor as you type. Choose Review and apply, then Apply.
The file holds up to 32 KiB. Lines the platform manages are refused with the reason, among them extensions, disable_functions, open_basedir and display_errors on production.
Effective values shows what PHP ends up with for the web and the command line.
History in the dialog's … menu lists every revision and restores an earlier one. Apply to other environments… copies the configuration to the site's other environments.
Automate this
Sets the memory limit, the upload size and the execution time, all three, within the site's bounds.
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
}'Your assistant calls corestack_php_settings_update.
{
"name": "corestack_php_settings_update",
"arguments": {
"site_id": 4211,
"version": 3,
"memory_limit_bytes": 805306368,
"upload_max_filesize_bytes": 67108864,
"max_execution_time_seconds": 120
}
}