As you might be knowing that php.ini is the configuration file for the PHP and resides at the server. It contains all the options/settings for the PHP language. There are instances you need to change these options. In local environment you can change these settings very easily but when on remote server you do not have permission to edit/change this file.
Before you can overwrite the php.ini values, you need to have the following two lines present at the top of your .htaccess file to make the changes work.
AllowOverride Options AllowOverride All
Following is the way to set values in php.ini using .htaccess. For example if you want to enable PHP error log and turn on the error display using .htaccess you will need to write the following in your .htaccess file.
php_flag display_errors On php_flag log_errors On
There are two kind of directives which can be set in .htaccess. php_value for the string type of values and php_flag for the boolean values. In the above example we used later to set the errors on which is a boolean value. An example to set php_value would be to change the default memory limit and default post size.
php_value post_max_size 8M php_value memory_limit 32M
You can change the values of various options listed in php.ini via .htaccess. Hope this helps.
Stay Digified !!