Update PHP default save path

This function sets the location of PHP's default session save path.

Important:

When you disable the Web Server role, the system disables this function.

SecurityBasicAuth
Request
query Parameters
overwrite
integer
Default: 0

Whether to overwrite the existing session save path in the php.ini file.

  • 1 — Overwrite the existing value in the php.ini file.
  • 0 — Do not overwrite the existing value in the php.ini file.
Enum: 0 1
Example: overwrite=0
path
string
Default: "/var/cpanel/php/sessions"

The directory in which to save session information.

Warning:

For security reasons, do not set this value to /tmp or another insecure location.

Example: path=/var/cpanel/php/sessions
Responses
200

HTTP Request was successful.

Response Schema: application/json
object
get/php_set_session_save_path
Request samples
whmapi1 --output=jsonpretty \
  php_set_session_save_path
Response samples
application/json
{
  • "metadata": {
    • "command": "php_set_session_save_path",
    • "reason": "OK",
    • "result": 1,
    • "version": 1
    }
}