List PHP versions on a server.
GET /api/server/{id}/php
Example request :
curl "https://cloud.boxydev.com/api/server/1/php" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json"
Example response :
[
{
"id": 1,
"version": "8.2",
"status": "installed",
"default": false,
"cli": false
},
{
"id": 2,
"version": "8.1",
"status": "installed",
"default": true,
"cli": true
}
]
Install a PHP version.
POST /api/server/{id}/php
Parameters :
| Parameter | Description |
|---|---|
| version | The PHP version: 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1 or 8.2. |
Example request :
curl "https://cloud.boxydev.com/api/server/1/php" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"version": "8.1"
}'
Path a PHP version.
PUT /api/server/{id}/php
Parameters :
| Parameter | Description |
|---|---|
| version | The PHP version: 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1 or 8.2. |
Example request :
curl -X PUT "https://cloud.boxydev.com/api/server/1/php" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"version": "8.1"
}'
Change PHP default when create site or PHP CLI in server.
PUT /api/server/{id}/php-default-{type}
Parameters :
| Parameter | Description |
|---|---|
| type | The PHP type: fpm or cli. |
| version | The PHP version: 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1 or 8.2. |
Example request :
curl -X PUT "https://cloud.boxydev.com/api/server/1/php-default-cli" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"version": "8.1"
}'
Update Composer to version 1 or 2.
PUT /api/server/{id}/composer
Example request :
curl -X PUT "https://cloud.boxydev.com/api/server/1/composer" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"version": 2
}'
Delete a PHP version.
DELETE /api/server/{id}/php
Parameters :
| Parameter | Description |
|---|---|
| version | The PHP version: 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1 or 8.2. |
Example request :
curl -X DELETE "https://cloud.boxydev.com/api/server/1/php" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"version": "8.1"
}'