php
The php commands control the PHP engine of one environment.
kinstactl php restart my-site --env livekinstactl php version my-site --env livekinstactl php version my-site 8.3 --env stagingBoth commands act on one environment, so pass --env in scripts; see Sites and environments. Changes wait for Kinsta to finish by default, and accept --no-wait, --timeout <minutes> and --dry-run; see operations.
php restart
Section titled “php restart”Restart the PHP engine of an environment.
kinstactl php restart my-site --env livekinstactl php restart [site] [options]Restart the PHP engine of an environment
Arguments
| Argument | Description |
|---|---|
site | site name, display name or ID |
Options
| Option | Description |
|---|---|
--env <environment> | environment name or ID |
--dry-run | print the resolved target and request; change nothing |
--no-wait | return the operation ID instead of waiting |
--timeout <minutes> | give up waiting after this many minutes (default 30) |
Global options --profile, --json and --no-input apply too. See scripting and CI.
Kinsta API: POST /sites/tools/restart-php
Restarting PHP drops the running PHP processes, for example to pick up a changed setting or to recover from stuck workers. It does not ask for confirmation. To change the number of PHP threads or the memory per thread instead, see sites php-allocation.
php version
Section titled “php version”Show the PHP version of an environment, or change it.
kinstactl php version my-site 8.3 --env stagingkinstactl php version <site> [version] [options]Show the PHP version of an environment, or change it
Arguments
| Argument | Description |
|---|---|
site | site name, display name or ID |
version | PHP version to switch to, e.g. 8.3 |
Options
| Option | Description |
|---|---|
--env <environment> | environment name or ID |
--no-auto-update | opt out of automatic PHP updates |
--dry-run | print the resolved target and request; change nothing |
--no-wait | return the operation ID instead of waiting |
--timeout <minutes> | give up waiting after this many minutes (default 30) |
Global options --profile, --json and --no-input apply too. See scripting and CI.
Kinsta API: GET /sites/{site_id}/environments, PUT /sites/tools/modify-php-version
Without a version, the command prints the current PHP version of the environment, in the same form (8.3) that you pass to change it:
kinstactl php version my-site --env liveWith a version, the environment is switched to it. --no-auto-update opts the environment out of automatic PHP updates, and only makes sense together with a version: without one it fails with a USAGE error. Try a new version on a staging environment first, and use --dry-run to check the request.