Switch PHP CLI version

Change the default PHP CLI version on your server.


POST/api/servers/{server}/php/cli-version

Switch PHP CLI version

This endpoint changes the default PHP CLI version on the specified server. The PHP version must already be installed on the server.

Required parameters

  • Name
    version
    Type
    string
    Description

    The PHP version you want to set as default CLI, e.g. 8.1, 8.2, 8.3. Must be an installed version on the server.

Request

POST
/api/servers/{server}/php/cli-version
curl -X POST "https://ploi.io/api/servers/{server}/php/cli-version" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  --data '{
    "version": "8.3"
  }'

Response

{
  "status": "ok",
  "message": "PHP CLI version has been changed to 8.3."
}

Error responses

When the PHP version is not installed on the server:

Error Response

{
  "message": "The given data was invalid.",
  "errors": [
    "This PHP version is not installed on the server."
  ],
  "links": [
    "https://developers.ploi.io/php/install-php-version"
  ]
}