PHP & Python Settings in Plesk โ
Switch PHP version per domain โ
- Open the subscription โ PHP Settings (or Websites & Domains โ PHP Settings).
- Select the PHP version from the dropdown โ available versions depend on what's installed on the server.
- Click OK. The change applies immediately.
Customize php.ini values โ
From the same PHP Settings page:
- Scroll to the Additional configuration directives section
- Enter custom
php.inivalues, one per line:
ini
memory_limit = 512M
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300
max_input_vars = 3000
display_errors = Off
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT- Click OK โ changes apply immediately without restart
Common settings for WordPress/WooCommerce โ
| Setting | Recommended | Why |
|---|---|---|
memory_limit | 512M | WooCommerce with many products needs headroom |
upload_max_filesize | 64M | Large media uploads |
max_execution_time | 300 | Long-running imports/exports |
max_input_vars | 5000 | Complex product attributes in WooCommerce |
PHP performance settings โ
Enable OPcache for faster PHP execution:
ini
opcache.enable = 1
opcache.memory_consumption = 256
opcache.interned_strings_buffer = 16
opcache.max_accelerated_files = 20000
opcache.revalidate_freq = 60PHP modes โ
Plesk supports multiple PHP execution modes:
| Mode | Description | Recommended |
|---|---|---|
| FPM | Separate process pool per subscription | Yes โ best isolation |
| FPM + Apache | FPM with Apache as reverse proxy | Yes on Nginx+Apache setups |
| CGI | Spawns new process per request | No โ slow |
| FastCGI | Persistent FastCGI process | Acceptable |
Set under PHP Settings โ PHP execution mode.
Python applications โ
Plesk supports hosting Python (Django, Flask) apps via Passenger:
- Subscription โ Websites & Domains โ Python
- Click Enable
- Set the Python version and application root
- Set the startup file (e.g.
passenger_wsgi.py) - Click OK
Example passenger_wsgi.py for Flask: โ
python
import sys
import os
INTERP = "/var/www/vhosts/yourdomain.com/venv/bin/python"
if sys.executable != INTERP:
os.execl(INTERP, INTERP, *sys.argv)
from app import app as applicationRestart the app after code changes: Python โ Restart.

