Change PHP settings
Need to change a PHP setting, such as max_execution_time or memory_limit?
This article describes the ways to change PHP settings.
The three places you can set them
Each one overrides the one above it:
- For the whole cluster, through Core.
- For one site, through Core, which overrides the cluster setting.
- For one directory, with a
.user.inifile, which overrides the per-site setting.
For one site only, .user.ini is the quickest and affects nothing else.
Per cluster
- Navigate to 'Servers' > 'Clusters'.
- Select the cluster.
- Navigate to 'Properties' > 'PHP'.
These apply to every site on the cluster, unless a site overrides them.
One-way switches
Two cluster-level toggles can be turned on but never back off:
- 'ionCube Enabled' — installs the ionCube loader.
- 'Sessions Spread Enabled' — spreads PHP sessions across nodes.
Flip these only when you want them permanently.
Custom PHP modules
Same rule: once a module is added to the cluster, it cannot be removed. Plan additions before turning them on.
Adding vips enables FFI globally
Adding the vips PHP module turns on PHP's FFI extension across the entire cluster. This has security implications — generally low-risk in standard shared-hosting contexts, but worth knowing before you flip the switch.
Removing a PHP version
A PHP version can only be removed from the cluster's 'PHP Versions' list when:
- No site runs on it, and
- No account has it as its default PHP version.
Switch those over first.
Per site
Set on the site's FPM pool, and overrides the cluster-level settings.
Directly
- Navigate to 'Advanced' > 'FPM Pools'.
- Select the FPM pool.
- Under 'Manage', click 'Update PHP Settings'.
Via the project
- Navigate to 'Projects'.
- Select the project.
- Navigate to 'Advanced'.
- Under the 'FPM Pool' tile, click 'Manage'.
- Under 'Manage', click 'Update PHP Settings'.
.user.ini
Create a file called .user.ini in the document root, for example:
/home/example/domains/example.com/htdocs/.user.ini
Put the setting in it:
max_execution_time = 60
The change applies only to PHP scripts in that document root and its subdirectories.