How to modify PHP settings (php.ini) on cPanel
PHP settings, the ones in the php.ini file, control script memory, upload size, execution time and error display. On OuiHeberg web hosting, the most common ones are set in the client area. The others are changed in cPanel with the MultiPHP INI Editor. This guide covers both, then what each directive does and the values to use for each type of site.
Modify PHP settings in the client area
Log in to dash.ouiheberg.com. In the left menu, click My Services, then your hosting plan.
Open the PHP version tab and scroll down to the PHP configuration card.
Change the value of the setting you need.
The PHP version per domain card is for changing versions: dash then asks you to confirm before applying. In the PHP configuration card, each line shows the setting's name and its PHP directive. Below it, the page shows the recommended value, the default value and the range allowed on your hosting. The card covers these directives, among others.
| Setting in the client area | Directive |
|---|---|
| Memory per Script | memory_limit |
| Script Duration | max_execution_time |
| Reading Received Data | max_input_time |
| Form Fields | max_input_vars |
| Uploaded File Size | upload_max_filesize |
| Form Size | post_max_size |
| File Uploads | file_uploads |

For other directives, such as display_errors, error_reporting or date.timezone, use cPanel. The guide Access cPanel and manage your OuiHeberg web hosting covers the rest of the page.
Method 1: MultiPHP INI Editor (basic mode)
The basic mode of the MultiPHP INI Editor shows the common directives as fields and switches.
On the hosting page, click Advanced panel at the top right. cPanel opens straight away, with no login details to type.
In the Software section, click MultiPHP INI Editor. You can also type "INI" in the Search Tools bar.
Stay on the Basic Mode tab.
In the list, pick the domain to configure. The home directory applies the settings to the whole account.
Change the values, then click Apply at the bottom of the page.
The screen shows the path of the file being edited, public_html/php.ini for the main domain, and the domain's PHP version. Basic mode lists about fifteen directives, including memory_limit, upload_max_filesize, post_max_size, max_execution_time, max_input_vars, display_errors and error_log. The exact list depends on the PHP version.

As the banner at the top of the screen says, the editor writes to php.ini, .user.ini and .htaccess, each directive only in the files that accept it. Do not edit these lines by hand.
Method 2: MultiPHP INI Editor (editor mode)
Editor mode opens the whole file. Use it for directives that basic mode does not show, such as date.timezone, error_reporting or max_input_nesting_level.
In the MultiPHP INI Editor, open the Editor Mode tab.
Pick the domain, or the home directory for the whole account.
Add or edit lines, one directive per line. A semicolon at the start of a line marks a comment.
Click Save, at the top right.
; Memory and limits
memory_limit = 512M
upload_max_filesize = 128M
post_max_size = 256M
; Execution time
max_execution_time = 600
max_input_time = 600
; Input variables
max_input_vars = 5000
; Errors (live site)
display_errors = Off
log_errors = On
error_reporting = E_ALL & ~E_DEPRECATED
; Sessions
session.gc_maxlifetime = 1440
; Time zone
date.timezone = Europe/London

A typo in this file can upset the whole PHP configuration. Change one directive at a time and check the site after each save.
Method 3: .user.ini file (PHP-FPM)
PHP runs with PHP-FPM on our servers. In this mode, PHP also reads the .user.ini files placed in the site's folders, so a folder can have its own settings.
In cPanel, open the File Manager, then the domain's root folder (
public_htmlfor the main domain).Create or edit the
.user.inifile. If it does not appear, show hidden files in the File Manager settings.Add one directive per line, then save.
memory_limit = 256M
upload_max_filesize = 64M
post_max_size = 128M
max_execution_time = 300
max_input_time = 300
max_input_vars = 3000
The setting applies to this folder and its subfolders. PHP rereads this file at regular intervals, so a change can take a few minutes to apply. Only directives that can be set per folder are taken into account. allow_url_fopen, allow_url_include, disable_functions and expose_php are not among them.
The MultiPHP INI Editor also writes to this file. Stick to one method per folder so you know which value applies.
Verify changes
In WordPress, open Tools › Site Health, Info tab. The Server section gives the memory limit, the maximum upload size, the execution time and the number of input variables.
Also in WordPress, the page for adding media shows the maximum file size.
To see everything, create an
info.phpfile inpublic_html, openhttps://mysite.com/info.phpand search for the directive with Ctrl+F.
<?php
phpinfo();
?>
The Local Value column of phpinfo gives the value that applies to the site. Delete info.php right after, as it exposes the server configuration.
When to modify PHP settings?
An error message often points to the directive to change.
| Message or symptom | Directive |
|---|---|
| The uploaded file exceeds the upload_max_filesize directive | upload_max_filesize |
| Allowed memory size exhausted | memory_limit |
| Maximum execution time exceeded | max_execution_time |
| POST Content-Length exceeds the limit | post_max_size |
| A long form or a menu is only partly saved | max_input_vars |
| An import or export stops halfway | max_execution_time, max_input_time |
Detailed description of settings
The recommended values below are starting points. Stay within the range the client area shows for each setting.
memory_limit
Maximum memory a PHP script can use, for example memory_limit = 256M.
| Type of site | Recommended value |
|---|---|
| Simple brochure site | 128M |
| WordPress blog | 256M |
| WordPress with many plugins | 256M to 512M |
| WooCommerce | 512M |
| Heavy PHP application | 512M to 1024M |
Fatal error: Allowed memory size of 134217728 bytes exhausted
upload_max_filesize
Maximum size of an uploaded file, for example upload_max_filesize = 64M.
| Use | Recommended value |
|---|---|
| Web-optimised images | 16M |
| High-resolution photos | 32M |
| WordPress themes and plugins | 64M |
| Short videos | 128M |
| Large files | 256M or more |
The uploaded file exceeds the upload_max_filesize directive in php.ini
post_max_size
Maximum size of all the data in a form, files included. It must be at least equal to upload_max_filesize, with some headroom for the other fields. With upload_max_filesize = 64M, use post_max_size = 128M for instance.
Warning: POST Content-Length of X bytes exceeds the limit of Y bytes
max_execution_time
Maximum run time of a script, in seconds, for example max_execution_time = 300.
| Task | Recommended value |
|---|---|
| Normal browsing | 30 (default value) |
| WordPress import or export | 300 |
| Report generation | 300 to 600 |
| Site migration | 600 to 900 |
| Backup run by a plugin | 600 |
Fatal error: Maximum execution time of 30 seconds exceeded
max_input_time
Maximum time PHP gets to read incoming data (forms, uploads), in seconds, for example max_input_time = 300. Allow 60 for simple forms, 300 for large uploads and 300 to 600 for a CSV or XML import. The value -1 reuses the max_execution_time duration.
max_input_vars
Maximum number of fields a form can send, for example max_input_vars = 3000.
| Type of content | Recommended value |
|---|---|
| Simple site | 1000 (default value) |
| WordPress with long menus | 3000 |
| WooCommerce with attributes | 5000 |
| Page builders (Elementor, Divi) | 5000 to 10000 |
A value that is too low shows up as WordPress menus saved halfway, theme options that vanish or lost WooCommerce variations.
display_errors
Shows PHP errors in the page. Keep it Off on a live site, because the messages can reveal paths or queries.
display_errors = Off ; live site
display_errors = On ; development only
error_reporting
Chooses which errors PHP reports.
| Value | Effect |
|---|---|
E_ALL | all errors |
E_ALL & ~E_NOTICE | everything except notices |
E_ALL & ~E_DEPRECATED | everything except deprecation warnings |
0 | no errors |
On a live site, keep errors in a log rather than on screen.
error_reporting = E_ALL & ~E_DEPRECATED
error_log
File where PHP writes errors. Handy for debugging without showing anything to visitors, for example with error_log = /home/user/logs/php_errors.log.
allow_url_fopen
Lets PHP open a web address as if it were a file. WordPress uses it for updates, RSS feeds and some APIs. It is usually left at allow_url_fopen = On.
allow_url_include
Allows remote code to be included with include or require. Keep allow_url_include = Off, because turning it on opens the door to code injection. The directive has also been deprecated since PHP 7.4.
Recommended configurations by site type
Copy the block that matches your site into editor mode or into .user.ini, then adjust it.
Brochure site or simple blog
memory_limit = 128M
upload_max_filesize = 32M
post_max_size = 64M
max_execution_time = 120
max_input_time = 120
max_input_vars = 1000
Standard WordPress
memory_limit = 256M
upload_max_filesize = 64M
post_max_size = 128M
max_execution_time = 300
max_input_time = 300
max_input_vars = 3000
WordPress with a page builder (Elementor, Divi, WPBakery)
memory_limit = 512M
upload_max_filesize = 128M
post_max_size = 256M
max_execution_time = 600
max_input_time = 600
max_input_vars = 10000
WooCommerce and online shops
memory_limit = 512M
upload_max_filesize = 128M
post_max_size = 256M
max_execution_time = 600
max_input_time = 600
max_input_vars = 5000
PrestaShop
memory_limit = 512M
upload_max_filesize = 64M
post_max_size = 128M
max_execution_time = 600
max_input_time = 600
max_input_vars = 20000
Custom PHP application or API
memory_limit = 256M
upload_max_filesize = 128M
post_max_size = 256M
max_execution_time = 300
max_input_time = 300
max_input_vars = 3000
allow_url_fopen = On
Troubleshooting
Changes not taking effect
| Possible cause | Solution |
|---|---|
.user.ini file not reread yet | Wait a few minutes, then reload phpinfo. |
| Wrong domain selected | Check the domain selected in the MultiPHP INI Editor. |
php_value line in .htaccess | Remove it and set the value in the client area or in the editor. |
| Directive set by the server | allow_url_fopen or disable_functions cannot be changed per folder. Open a ticket if phpinfo does not show the value you want. |
| Value outside the allowed range | Use a value within the range shown in the client area. |
"The uploaded file exceeds the upload_max_filesize directive in php.ini"
WordPress shows this message when a file is larger than upload_max_filesize. If the limit shown on the page for adding media does not change after you raise it, check these points in order.
upload_max_filesizehas the new value in phpinfo, Local Value column.post_max_sizeis at least equal toupload_max_filesize.No plugin or theme sets its own limit.
500 error after a change
Undo the last change in the MultiPHP INI Editor or in .user.ini, then add the directives back one by one to find the one at fault. If you added php_value or php_flag lines to .htaccess, delete them with the File Manager.
"php_value not allowed here"
The cPanel error log (Metrics section, Errors tool) shows one of these messages when .htaccess contains a php_value line. With PHP-FPM, Apache does not know this command, and the whole site returns a 500 error.
.htaccess: php_value not allowed here
.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
Delete the line from .htaccess, then set the value in the client area, in the MultiPHP INI Editor or in .user.ini.
max_input_vars ignored
Check the value in phpinfo, Local Value column. If it is right but a WordPress menu still gets cut, reduce the number of menu items or split it into several menus.
Complete list of useful PHP directives
| Directive | Role | Example |
|---|---|---|
memory_limit | maximum memory per script | 256M |
max_execution_time | maximum run time, in seconds | 300 |
max_input_time | maximum time to read incoming data | 300 |
max_input_vars | maximum number of incoming fields | 3000 |
max_input_nesting_level | maximum depth of incoming arrays | 64 |
upload_max_filesize | maximum size of an uploaded file | 64M |
post_max_size | maximum size of a form | 128M |
max_file_uploads | number of files uploaded at once | 20 |
file_uploads | allows file uploads | On |
display_errors | shows errors in the page | Off |
log_errors | writes errors to a log | On |
error_reporting | level of reported errors | E_ALL & ~E_DEPRECATED |
error_log | error log file | /home/user/logs/php_errors.log |
session.gc_maxlifetime | lifetime of a session, in seconds | 1440 |
session.cookie_lifetime | lifetime of the session cookie (0 until the browser closes) | 0 |
allow_url_fopen | opens a web address as a file | On |
allow_url_include | includes remote code | Off |
expose_php | shows the PHP version in the headers | Off |
disable_functions | disabled functions | exec,shell_exec |
date.timezone | time zone | Europe/London |
default_charset | default encoding | UTF-8 |
short_open_tag | accepts the short <? tag | Off |
output_buffering | output buffer, in bytes | 4096 |
allow_url_include, expose_php and disable_functions are set at server level. To change one, open a ticket.
Need help?
Open a ticket from Tickets › Open a ticket (dash.ouiheberg.com/tickets/new), or click the Contact support tile at the bottom of your hosting page. You can also ask your question on our Discord.
cPanel hosting with email accounts and databases, managed from the OuiHeberg client area.
View plans →