# php_handler.exe: Custom PHP Handlers

The `php_handler` utility is used to register custom PHP handlers, which allow you to use multiple PHP versions and multiple `php.ini` files in Plesk. For more information, see Multiple PHP Versions in the Administrator’s Guide.

By using the `php_handler` utility, you can perform the following tasks:

- changing a certain PHP handler in service plans and subscriptions
- listing registered PHP handlers in JSON format

## Location

`%plesk_cli%`

## Usage

    php_handler.exe <command> [
    <option_1> [<param>]
    [<option_2> [<param>]]
    ... [<option_N> [<param>]]
    ]

## Example

The following command enables the custom PHP handler with ID 3.

    plesk bin php_handler.exe --enable -id 3

## Commands

Command | Parameter | Description | Example
--- | --- | --- | ---
`--replace` |  | Replaces a certain PHP handler with another one for all service plans and websites in Plesk. | To replace the PHP handler (id=*123*) with another PHP handler (id=*789*):
    plesk bin php_handler.exe --replace -old-id 123 -new-id 789
`--enable` |  | Enables the specified PHP handler. | To enable the plesk-php52-cgi PHP handler:
    plesk bin php_handler.exe --enable -id plesk-php52-cgi
`--disable` |  | Disables the specified PHP handler. | To disable the plesk-php52-cgi PHP handler:
    plesk bin php_handler.exe --disable -id plesk-php52-cgi
`--get-usage` |  | Displays the usage of the specified PHP handler. | To get the usage of the plesk-php52-cgi PHP handler:
    plesk bin php_handler.exe --get-usage -id plesk-php52-cgi
`--list` |  | Displays the list of all PHP handlers registered in Plesk. | To view all registered PHP handlers:
    plesk bin php_handler.exe --list
`--reread` |  | Refreshes information about PHP handlers in Plesk. Use this command after you changed PHP handlers properties not through Plesk. | To refresh information about PHP handlers in Plesk:
    plesk bin php_handler.exe --reread
`--help` or `-h` |  | Displays help on the use of the utility. | To view help on the use of the utility:
    plesk bin php_handler.exe --help
or
    plesk bin php_handler.exe -h

## Options

Option | Parameter | Description | Example
--- | --- | --- | ---
`-id` | `<handler id>` | Sets the PHP handler identifier. | To get the usage information for the PHP handler with the ID 5:
    plesk bin php_handler.exe --get-usage -id 5
`-old-id` | `<old handler id>` | Specifies the PHP handler you want to replace. | To replace the PHP handler (id=*123*) with another PHP handler (id=*789*):
    plesk bin php_handler.exe --replace -old-id 123 -new-id 789
`-new-id` | `<new handler id>` | Specifies the PHP handler with which you want to replace the existing one. |
`-json` | `true|false` | Displays the output in the JSON format. | To display the list of PHP handlers in the JSON format:
    plesk bin php_handler.exe --list -json