Chat / support@radicenter.eu

PHP ini settings / modify settings howto

All users can change global PHP settings via cPanel or .htaccess or by including ini_set() in their PHP conf file on cPanel servers.

1. On cPanel server depending from domain and PHP version:
– Log on to cPanel
– SOFTWARE -> MultiPHP INI Editor -> Basic Mode (if You wish to change main settings) -> Select domain -> Make required modifications and save.
– SOFTWARE -> MultiPHP INI Editor -> Editor Mode (if You wish to change/add/remove different PHP variables) -> Select domain -> Make required modifications and save.

2. PHP script/file change/modify settings with ini_set():

ini_set('what_to_change', 0/1);

More info HERE

3. In .htaccess file:
Modifying settings via .htaccess file. If you want your settings to apply to every folder under your domain, create/move/modify your .htaccess file in root folder of your website (public_html)

Changing boolean type system settings in PHP thru .htaccess:
With directive php_flag.
Example:

php_flag register_globals Off
php_flag magic_quotes_gpc Off

Boolean type variables settings are 0 and 1 or on and off.
Other variables are set with option php_value.
Example:

php_value upload_max_filesize 20M

More info from here:
http://www.php.net/manual/en/ini.list.php

Most often used modifications/examples:

max_execution_time This sets the maximum time in seconds a script is allowed to run before it is terminated by the parser. This helps prevent poorly written scripts from tying up the server. The default setting is 60 sec.

max_input_time This sets the maximum time in seconds a script is allowed to parse input data, like POST and GET. It is measured from the moment of receiving all data on the server to the start of script execution. The default setting is 60 sec.

memory_limit This sets the maximum amount of memory in bytes that a script is allowed to allocate. This helps prevent poorly written scripts for eating up all available memory on a server. The default setting is 48M.

upload_max_filesize The maximum size of an uploaded file.
When an integer is used, the value is measured in bytes. The default setting is 32M.

post_max_size Sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize. If memory limit is enabled by your configure script, memory_limit also affects file uploading. Generally speaking, memory_limit should be larger than post_max_size. The default setting is 48M.

register_globals Whether or not to register the EGPCS (Environment, GET, POST, Cookie, Server) variables as global variables. This feature has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0.

Comments are currently closed.

This website utilizes cookies and similar technologies for functionality and other purposes. Your use of this website constitutes your acceptance of cookies.
Ok, got it.