Shared hosting has disabled ini_set() function for security reason
if the hosting provider turn on ini_set() to you, you can have full access to php variable control, which the hosting provider don't want
for your purpose, you can do it through .htaccess file within your application root folder
two directives are permitted using .htaccess
php_flag <boolean-flag-name> on|off
php_value <flag-name> <flag-value>
php_flag should be used for on/off values
For example, the following .htaccess file will disable globals, set the maximum file upload size to 20MB, and allow PHP scripts to run for 10 minutes (600 seconds):
php_flag register_globals off
php_value upload_max_filesize 20M
php_value max_execution_time 600
You can also use ini_set function. in php scripts which allows you to change a setting within your application at runtime. The function accepts two arguments:
ini_set(flag-name, flag-value),
Example
<?php
ini_set('register_globals', 0);
ini_set('upload_max_filesize', '20M');
ini_set('max_execution_time', 600);
?>
We can query the php interpreter before changing these value to query, we can use ini_get() method
ini_get(flag-name)
Returns the configuration value. I’d recommend checking your configuration change and taking appropriate action. Don’t assume ini_get() will always work.
ini_get_all([extension])
Returns all configuration values as an associative array. The optional extension parameter returns options specific to that extension, e.g. ‘allow_url_fopen’.
get_cfg_var(flag-name)
Returns the original configuration value from php.ini (not any overrides set in .htaccess or by ini_set).
ini_restore(flag-name)
Returns a configuration option to its original value.