There are times when you need to add custom directives in your php.ini and use it for a specific directory or for your entire website. There are two steps involved to force your server to use the updated php.ini and not he default one.
First copy the existing php.ini file from this usual location “/usr/local/lib/php.ini” to your required directory. Copying the existing file is important because you don’t want to lose the current configurations.
You can easily copy the file from the above location using the shell copy command, run the following command form shell:
$ cp /usr/local/lib/php.ini /home/cpusername/public_html/your-directory
Now edit your php.ini file and update it as you wish.
Now open your .htaccess file in the same directory you copied the php.ini file and put following line forcing it to use this php.ini file:
SetEnv PHPRC /home/cpusername/public_html/your-directory/php.ini
Hope that helps.
Cheers!