Skip to main content

Global PHP Settings via Panel Settings (Server-Wide)

cPGuard X provides flexible options to customize PHP behavior, allowing you to fine-tune settings based on your server's specific requirements. Understanding the two available configuration methods helps you manage PHP efficiently across single or multi-site environments.

Two Ways to Configure PHP in cPGuard X

MethodScopeBest Used When
Per-Domain ConfigurationApplies to a single websiteDifferent sites need different PHP settings
Global PHP ConfigurationApplies server-wide to all websitesYou want consistent base settings across all sites

This guide focuses on the Global PHP Configuration approach. For per-domain settings, refer to the Per-Domain PHP Settings guide.


What is Global PHP Configuration?

Global PHP settings act as default base configurations that apply to all websites hosted on the server. These defaults are used for:

  • Newly created websites that haven't been individually configured
  • Consistent server-wide PHP behavior without per-site overrides
  • Centralised management of php.ini values and PHP-FPM process settings
note

Global settings can always be overridden at the individual website level through the per-domain PHP settings interface.


Steps to Configure Global PHP Settings

Step 1 : Access Panel Settings

Log in to your cPGuard X control panel and navigate to the Settings section from the main dashboard. Logo

Step 2 : Locate the PHP Configuration Options

Under Settings, you will find two PHP-related configuration sections:

  • PHP INI Configuration — for managing php.ini directives server-wide Logo

  • PHP-FPM Settings — for managing process management parameters server-wide

Logo

Step 3 : Adjust Directives and Save

Modify the PHP directives and FPM parameters as required. Common directives you may want to configure include:

PHP INI Configuration

DirectiveDescription
memory_limitMaximum amount of memory a PHP script may consume
max_execution_timeMaximum time (in seconds) a script is allowed to run
max_input_timeMaximum time in seconds a script is allowed to parse input data
post_max_sizeMaximum size of POST data PHP will accept
upload_max_filesizeMaximum size of an uploaded file
error_reportingSet the level of error reporting
display_errorsWhether to display errors in the browser output
log_errorsEnable the logging of PHP errors
allow_url_fopenAllows PHP file functions to retrieve data from remote locations over FTP or HTTP
file_uploadsAllows uploading files over HTTP
short_open_tagAllows the short form of the PHP's open tag
opcache.enableEnables the opcode cache
disable_functionsThis directive allows you to disable certain functions

PHP-FPM Settings

DirectiveDescription
pmDefines the process management mode: static, dynamic, or ondemand
pm.max_childrenSets the limit on the number of simultaneous requests that will be served
pm.max_requestsSpecifies how many requests each PHP process handles before restarting
pm.start_serversNumber of PHP processes started on service launch
pm.min_spare_serversMinimum number of idle PHP processes to keep available
pm.max_spare_serversMaximum number of idle PHP processes allowed

Once you have made the necessary changes, click Save to apply the configuration.

info

These global settings will take effect across all websites on the server unless a specific website has its own PHP settings configured at the domain level.


Global vs Per-Domain: How Overrides Work

cPGuard X uses a straightforward override hierarchy. Which means If a website has its own PHP settings configured, those take priority over the global defaults. If no per-domain settings exist, the global configuration applies automatically.


Summary

The Global PHP Settings feature in cPGuard X gives server administrators a single place to define consistent, server-wide PHP defaults. This is particularly useful when managing multiple websites and wanting to ensure a reliable baseline configuration without needing to configure each site individually.

For more granular control on a per-site basis, see Per-Domain PHP Settings.