# Choosing the PHP Handler

Содержание

Many modern websites and web applications, such as WordPress, are written in the PHP programming language. For such a website or web application to work correctly, PHP support must be enabled for it in Plesk, and a PHP handler must be selected.

In this topic, you will learn about the different PHP handlers supported in Plesk, and also how to choose the one most suitable for your website.

## Общие сведения об обновлениях

As part of enabling and configuring PHP support for a website in Plesk, a PHP handler for it must be selected. A PHP handler is a mechanism for processing PHP code so that the website or web application can work correctly.

Only one PHP handler can be selected for a website at a time, and one must be selected for every website that has PHP support enabled. It is important to choose a suitable PHP handler. Otherwise, the website or web application may load slowly, consume an excessive amount of server resources, or not work at all.

Plesk supports the «FastCGI application» PHP handler on both Linux and Windows. In addition, in Plesk for Linux, the «FPM application» and the «Dedicated FPM application» handlers are also supported, and can be served by either Apache or nginx.

Примечание

Plesk Obsidian does also support the «ISAPI module», «mod_php served by Apache», and «CGI application» PHP handlers. However, they are not recommended for use because they are severely outdated and/or insecure. For that reason, they are not covered in this topic.

## (Plesk for Linux) PHP Handlers served by Apache or nginx

In Plesk for Linux, the «FastCGI application» PHP handler is always served by the Apache web server. However, the «FPM application» and the «Dedicated FPM application» PHP handlers can be served by either Apache or nginx.

Примечание

If the «Proxy mode» checkbox is not selected on a website’s «Apache & nginx Settings» page, no PHP handlers served by Apache would be available for that website.

The main difference between the two options is that PHP handlers served by nginx ignore the contents of the `.htaccess` file, which is sometimes used to fine-tune a website’s configuration. If a website or web application that needs the rules in the `.htaccess` file is configured to use a PHP handler that is served by nginx, it may not always work correctly.

If your website or web application does need the rules in the `.htaccess` file to work, you have the following options:

- Use a PHP handler served by Apache.

- Convert those rules to a format understood by nginx as described in this KB article.

## Information About PHP Handlers

The following handlers are all industry standard and are recommended for use. Read on to learn about the differences between them.

### FastCGI application

An improvement upon the CGI application PHP handler. This is the recommended PHP handler on Plesk for Windows servers.

The FastCGI application PHP handler processes run continuously, providing fair performance and good isolation.

### (Plesk for Linux) FPM application

A further improvement upon the FastCGI application PHP handler. This is the recommended PHP handler on dedicated Plesk for Linux servers.

A standout feature of the «FPM application» PHP handler is the support for Opcode caching. It enables the handler to store compiled PHP scripts in memory. This results in improved performance at the cost of increased memory usage.

All websites using the «FPM application» PHP handler and the same PHP version share the same pool of PHP-FPM processes. This has the following drawbacks:

- Poorer caching performance compared to the «Dedicated FPM application» PHP handler, because cached scripts for one website can be dropped to make space for the scripts of another.

- Lack of isolation, which may result in a single malfunctioning website bringing down every other website using the same PHP version and handler.

### (Plesk for Linux) Dedicated FPM application

Same as the «FPM application» PHP handler, but with separate pools of PHP-FPM processes for each website. This is the recommended PHP handler on Plesk for Linux servers used for shared hosting.

Having a separate pool of PHP-FPM processes for each website results in improved isolation compared to the «FPM application» PHP handler. It also results in maximum possible performance thanks to the separate Opcode cache for each website, which prevents the situation where many websites are competing for the shared cache, and no individual script remains in the cache for long.

However, this also increases the amount of memory used for the Opcode cache. When using this PHP handler on servers hosting a significant number of websites, we recommend that you monitor the server to make sure that it does not run out of memory.

Примечание

Plesk offers both free and paid options for monitoring the server. Learn about server monitoring in Plesk.