Skip to content

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.


PHP settings can be changed:

  • Through Core, per cluster.
  • Through Core, per FPM pool — overrides the cluster setting.
  • Through .user.ini, per document root — overrides the FPM pool setting.

Core

Per cluster

PHP settings can be configured for the entire cluster.

  1. Navigate to 'Servers' > 'Clusters'.
  2. Select the cluster.
  3. Navigate to 'Properties' > 'PHP'.

These settings apply to all FPM pools in the cluster, unless overridden per FPM pool.

One-way switches

A few cluster-level PHP toggles can be turned on but never back off:

  • 'ionCube Enabled' — installs the ionCube loader. Once on, can't be disabled.
  • 'Sessions Spread Enabled' — spreads PHP sessions across nodes. Once on, can't be disabled.

Flip these only when you're sure you want them permanently.

Custom PHP modules

The list of installed custom PHP modules works the same way: once a module is added to the cluster, it cannot be removed again. 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 flipping the switch.

Removing a PHP version

A PHP version can only be removed from the cluster's 'PHP Versions' list when no FPM pool uses it as its version, and no UNIX user uses it as its default PHP version. Switch those over first.

Per FPM pool

Each project has an FPM pool. PHP settings configured per FPM pool override the cluster-level settings.

There are two ways to navigate to the PHP settings of an FPM pool:

Directly

  1. Navigate to 'Advanced' > 'FPM Pools'.
  2. Select the FPM pool.
  3. Under 'Manage', click 'Update PHP Settings'.

Via the project

  1. Navigate to 'Projects'.
  2. Select the project.
  3. Navigate to 'Advanced'.
  4. Under the 'FPM Pool' tile, click 'Manage'.
  5. Under 'Manage', click 'Update PHP Settings'.

.user.ini

In the document root, create a file called .user.ini. For example:

/home/example/domains/example.com/htdocs/.user.ini

In this file, set the PHP setting. For example:

max_execution_time = 60

The change applies only to PHP scripts in that document root (and its subdirectories).